Firebirdsql wrapper inspired by subprocess.run
Project description
firebirdsql-run
Firebirdsql wrapper inspired by subprocess.run
Installation
pip install firebirdsql-run
Examples
Execute
maker | model | type |
---|---|---|
B | 1121 | PC |
A | 1232 | PC |
result = execute(
query="SELECT * FROM TABLE",
host="localhost",
db="fdb",
user="sysdba",
passwd=getenv("FB_PASSWORD"),
)
if result.returncode != 0:
log.error(result)
else:
log.info(result)
Info
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
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",
passwd=getenv("FB_PASSWORD"),
)
execute(use_conn=conn, query="SELECT * FROM TABLE")
...
callproc(use_conn=conn, procname="PROCNAME", params=(...))
...
conn.close()
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.1.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for firebirdsql_run-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee1cfb75d138ca131ea71cfa7b5f45b7b7f53d183228cfca7a23c01fa57497df |
|
MD5 | 498979ae4f59497d1c848fb4c71b3766 |
|
BLAKE2b-256 | 92fc85c96d901a4f2cd91d1fe599a62221ff56473d81238aaa5bdbd7c726df06 |