Firebirdsql wrapper inspired by subprocess.run
Project description
firebirdsql-run
Firebirdsql wrapper inspired by subprocess.run
Installation
pip install firebirdsql-run
Examples
Table
maker | model | type |
---|---|---|
B | 1121 | PC |
A | 1232 | PC |
Execute
result = execute(
query="SELECT * FROM TABLE",
host="localhost",
db="fdb",
user="sysdba",
)
if result.returncode != 0:
log.error(result)
else:
log.info(result)
Info result example
CompletedTransaction(
host="localhost",
db="fdb",
user="sysdba",
returncode=0,
error="",
query="SELECT * FROM TABLE",
params=(),
data=[
{"maker": "B", "model": 1121, "type": "PC"},
{"maker": "A", "model": 1232, "type": "PC"},
],
)
Error result example
CompletedTransaction(
host="localhost",
db="fdb",
user="sysdba",
returncode=1,
error="Dynamic SQL Error\nSQL error code = -204\nTable unknown\nTABLE\nAt line 1, column 15\n",
query="SELECT * FROM TABLE",
params=(),
data=[],
)
Reuse connection
conn = connection(host="localhost", db="fdb", user="sysdba")
execute(use_conn=conn, query="SELECT * FROM TABLE")
...
callproc(use_conn=conn, procname="PROCNAME", params=(...))
...
conn.close()
Env variables
FIREBIRD_KEY=
The FIREBIRD_KEY
environment variable can be overridden with the function argument passwd
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
firebirdsql_run-1.0.6.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file firebirdsql_run-1.0.6.tar.gz
.
File metadata
- Download URL: firebirdsql_run-1.0.6.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e3cdcb7aa58f7967fe5f95122900e99346a1e9239c593f6ac58ef17dd34b2b5 |
|
MD5 | caf60ddbd3ba3d76fd9ba31dea2cdc21 |
|
BLAKE2b-256 | 53b56c422a286c42d1f7d601c1dbd78150be9490295d0f9cb8389d84e3315024 |
File details
Details for the file firebirdsql_run-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: firebirdsql_run-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8fa91bf5bb7b4c081928e1a73036e97c126e5e3a27ebaa4117cd7ef0241a8b6 |
|
MD5 | 4eaff4c0de57b8ffd4b67f4dcf282288 |
|
BLAKE2b-256 | 90178e42d6919e3bf031527d84c89c1beec50acf2212b2dc4e5d43808252e0a8 |