Repository navigation
v0.9.0
This release adds the driver libsql, for libSQL and Turso, which serve SQLite over the Hrana protocol. No other driver changes for a caller.
New
- libSQL and Turso. The package
libsqlruns SQL onsqld, the libSQL server, and on Turso Cloud, measured onsqld0.24.33. The DSN islibsql://user:token@host:port, with the keystls,authandnamespace(D148). TLS is on by default, and a DSN withtls=falsenames its port. The token goes asAuthorization: Bearer, andauth=basicsends basic authentication forsqldwithSQLD_HTTP_AUTH.dburlnamestursoas an alias (D76). - Reading. A query reads its rows from
/v3/cursorone entry at a time, with no cap on the size, where a pipeline stops at 10MB. The driver closes the stream of the cursor after its rows. An error after some rows wrapsdbimp.ErrIncomplete(D149). - Transactions.
BeginTxsendsBEGINon a stream, which its baton holds across requests. A stream with no statement for 10 seconds expires, the server rolls back its transaction, and the next statement says so.ReadOnlyand any isolation level but the default fail withdbimp.ErrNotSupported, because the server keeps no transaction read-only (D150). - Types. A value has the Go type of the affinity of its declared type, as for rqlite, and a value of another storage class keeps its own Go type. A
BOOLEANis abool, aDATEadbimp.Date, aDATETIMEadbimp.LocalDateTime, aTIMESTAMPatime.Time, and anF32_BLOBadbimp.Vector[float32]. The server sends an infinity with no sign, so it reads as+Inf, andCAST(x AS TEXT)in the statement keeps the sign (D147). - Arguments. The server binds each argument as a typed value, positional or named, but not both in one statement (D152).
- Options.
WithTimeout,WithParameter,WithDatabaseandWithNamespaceapply to one statement.WithTimeoutends the request, and the server stops the statement when its client leaves.WithReadonly(true)fails, because the server cannot keep a statement read-only.
Other changes
- The rules of affinity of SQLite are in the root package, as
dbimp.Affinityanddbimp.AffinityOf, and the rqlite driver uses them. Its behavior does not change. - The workflow pins dbmeta at
a59c0c1, which runssqldwith a token that can write and a token that can only read.