frostlake (Python driver)
A pure-stdlib DB-API 2.0 (PEP 249) driver for Frostlake, speaking
the engine's HTTP protocol against a running DatabaseHttpServer. No JVM, no dependencies.
Engine version
Requires a Frostlake engine 0.0.7 or newer. Ask a running server which one it is with
SELECT CURRENT_VERSION() — every release answers it, so the check works against any engine.
The driver versions independently of the engine: it speaks the HTTP protocol, not the jar, so this is a floor rather than a lockstep pin.
Usage
import frostlake
conn = frostlake.connect("frostlake://localhost:18082/MY_DB?schema=PUBLIC")
cur = conn.cursor()
cur.execute("SELECT id, name FROM people WHERE id = ?", (1,))
for row in cur:
print(row)
connect() accepts a DSN (frostlake://host:port[/DATABASE][?schema=SCHEMA]) or
host=/port=/database=/schema= keywords. The DSN's database/schema apply as USE
statements on the connection's session before its first statement.
Semantics
paramstyle = "qmark"; parameters are inlined client-side with the same rules as Frostlake's JDBC driver (strings escape backslashes and quotes;bytesbinds as a hexBINARYliteral;datetime/date/timeas typed literals; lists as array literals). A?inside a string literal, quoted identifier or comment is never a placeholder.- Types: fixed-point
NUMBER/DECIMALwith a scale →decimal.Decimalcarrying the exact digits the server sent; scale-0 numerics →int;FLOAT/DOUBLE/REAL→float;BOOLEAN→bool;DATE/TIME/TIMESTAMP*→datetime.date/time/datetime; semi-structured cells (VARIANT/OBJECT/ARRAY) as the JSON text the engine returns. - Type objects and constructors: the PEP 249 singletons
STRING,BINARY,NUMBER,DATETIME,ROWIDcompare equal to the engine type names in their family, socur.description[i][1] == frostlake.NUMBERworks (parameterized spellings likeNUMBER(38,10)included).Date,Time,Timestamp, the*FromTicksvariants andBinaryare all present.ROWIDmatches nothing — the engine has no rowid. - Multi-statement:
execute()exposes the first result set;cursor.nextset()steps to the next and returnsNoneonce the last one is current. - Transactions: connections start in autocommit rather than the strict DB-API
default;
conn.begin()orconn.autocommit = Falsefor explicit transactions, thencommit()/rollback(). With autocommit off the connection stays transactional — ending one transaction opens the next. cursor.rowcountis derived from the engine's one-cell DML result (number of rows inserted/updated/deleted).cursor.lastrowidis alwaysNone.cursor.callproc(name, params)issuesCALL name(...)and returns the input sequence unchanged; the engine has no OUT parameters, so any result is read with the fetch methods.- Using a closed cursor or connection raises
InterfaceError; fetching before anyexecute()raisesProgrammingError. - The exception classes are also reachable as connection attributes (
conn.Error, …). - One HTTP session per connection.
Tests
test_frostlake_unit.py needs no server and no JVM:
python3 -m unittest test_frostlake_unit -v
test_frostlake.py boots a real engine and needs both:
JAVA_HOME=~/.jdks/liberica-17.0.18 \
FROSTLAKE_CLASSPATH="<engine classes>:<dependency classpath>" \
python3 -m unittest -v
Unset FROSTLAKE_CLASSPATH skips the integration suite; the unit suite still runs.
Metadata
Release files for frostlake 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| frostlake-0.2.0.tar.gz | 23.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| frostlake-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.6 kB
Release files / frostlake-0.2.0.tar.gz
| Download URL | frostlake-0.2.0.tar.gz |
|---|---|
| Size | 23.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2b9c5bcaa3ff8a81785ec8f1f11628aac587d4956b9e4efb82f74b8e78c9fa
|
|
BLAKE2b-256 checksum How to use checksums |
088bf7a56985c0700e69cd44f45045a7a28d2828fc11ee810f0359d645d98bbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / frostlake-0.2.0-py3-none-any.whl
| Download URL | frostlake-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c95cd21cc7c422d7c6a728bdee1dc774ec138fe9746c3989ce802fdc5b67b50
|
|
BLAKE2b-256 checksum How to use checksums |
b89c72b37584841d39a96b4726f6dc4b7bdc3138ce85f3646b9d715b110f30af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|