Skip to main content

Firebirdsql wrapper inspired by subprocess.run

Project description

firebirdsql-run

Firebirdsql wrapper inspired by subprocess.run

PyPI version Main pre-commit.ci codecov

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",
)

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 optional function argument passwd.

Project details


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.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

firebirdsql_run-1.0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file firebirdsql_run-1.0.3.tar.gz.

File metadata

  • Download URL: firebirdsql_run-1.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for firebirdsql_run-1.0.3.tar.gz
Algorithm Hash digest
SHA256 add82e31c92c09dc7bca71c6480595c30a4eba4cc63752dc9684be48d3a36d4b
MD5 17d8c996650f9652af560bb4b585124f
BLAKE2b-256 cb18367a85bb6f70ce86bff1385483d5643ba167f0c904213320b61d13eee249

See more details on using hashes here.

File details

Details for the file firebirdsql_run-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for firebirdsql_run-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 65cb10362128ab7edd2f04f59b41f96c8a5c00438604a9b5cd9723282b781b6c
MD5 2384c3707874beda41c136d02f8bc94c
BLAKE2b-256 53130aed1cab323408304bf5a69fb9a4ea3c2082d860abc67c372ea704c4c7fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page