Skip to main content

Firebirdsql wrapper inspired by subprocess.run

Project description

firebirdsql-run

Firebirdsql wrapper inspired by subprocess.run

PyPI version CI/CD CodeQL pre-commit.ci status 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",
    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


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.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

firebirdsql_run-1.0.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

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