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.4.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for firebirdsql_run-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 223d5a430072b6e01e74d79ad30b22f38c42e60260256bcbe9fc90c1c431adf7 |
|
MD5 | e8072541140725c2972d82225be68de2 |
|
BLAKE2b-256 | 3c2e0d6af1b8780338bc15107958cfc680ad42dcb39382d67a0b92fa77e793cf |