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.5.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file firebirdsql_run-1.0.5.tar.gz
.
File metadata
- Download URL: firebirdsql_run-1.0.5.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f778a963e4e2afcfdbf5b0ca3ef7afc969e8883072b378099c3ad39eeeed090a |
|
MD5 | e7a3143f014afaf52d892390bc8a833d |
|
BLAKE2b-256 | b612059d168f5c1b1621f5feda500f66ee9d750a84df1196770f3621e4b6a5ff |
File details
Details for the file firebirdsql_run-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: firebirdsql_run-1.0.5-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08f487afe2e5c158d8ca434f902a0817220f148373ac72ff0a120d7b39da6c9a |
|
MD5 | 565593b73ddaea00e2869c4f3224f552 |
|
BLAKE2b-256 | bffff1ee2995392880f64d787bf711451e5ece3a54987e68369bb98c95ab24e9 |