frostlake 0.2.0
frostlake: ^0.2.0 copied to clipboard
Zero-dependency Dart driver for the Frostlake SQL engine, speaking its HTTP protocol against a running DatabaseHttpServer.
Changelog #
0.2.0 #
- A colon glued to a
?reads a path off the bound value.SELECT ?:awas refused as mixing?and:nameplaceholders, whatever arguments came with it; a?now ends an operand as a name, a closing bracket or a quote already did. Spaced off (? :a), the colon still opens a:nameplaceholder. - A connection keeps its engine session in step with the engine's. Against an engine that
reports
newSession(0.1.0 and later), every request naming the session sendsrequireSession: true, so a session the engine lost (idle expiry, release, restart) is refused with HTTP 404 instead of quietly replaced at the server's default scope. The driver then puts the DSN's scope on a fresh session and sends the statement once more — or, when the lost session held an open transaction or context of the caller's own (USE,SET/UNSET,ALTER SESSION, a temporary object,CREATE/DROPof a database or schema), raises the newSessionLostExceptionand leaves the connection usable. An exhaustiveswitchoverFrostlakeExceptionneeds a case for it. closereleases the session withDELETE /api/sessions/{id}, which also rolls back a transaction left open on it: best effort, at most five seconds, never an error. Engines before 0.1.0 are sent neither the flag nor theDELETE, and keep theidleLimitre-scope, which the newer ones no longer need.- Requires a Frostlake engine 0.2.0 or newer.
0.1.0 #
First release. A dependency-free Dart driver for Frostlake over the engine's HTTP protocol, verified against engine 0.0.7.
connectopens a connection and applies the DSN's role, warehouse, database and schema before the first statement, so a name that does not exist is reported at connect.execute/executeAllfor positional?parameters,executeNamed/executeAllNamedfor:name. Binding is client-side, skipping string literals, quoted identifiers, dollar-quoted bodies and comments, and refusing a count mismatch whenever arguments are supplied; with none at all the?marks pass through to the server, where a Snowflake Scripting cursor binds them.Resultreports the grid positionally and keyed by column name, with column metadata, a DMLupdateCountand the raw counters behind it.- Types map to Dart natives:
BigIntfor aNUMBERpast 64 bits,Uint8ListforBINARY,DurationforTIME,DateTimefor the date and timestamp types. begin/commit/rollbackand atransactionhelper that rolls back on a throw.- Failures are typed:
QueryException,ConnectionException,UsageException, all underFrostlakeException. - Statements on one connection are serialized, so a connection maps to one engine session however many callers await it at once.
- Unit tests that need no engine, and integration tests that boot a real
DatabaseHttpServerand skip themselves when none is configured: no failures.