Repository navigation
v0.8.0
This release adds the driver rqlite, for rqlite, the distributed database that runs SQLite on each node. No other driver changes.
New
- rqlite. The package
rqliteruns the SQL of SQLite on a node of rqlite over its HTTP API, measured on 9.4.5 and 10.3.6. The DSN isrqlite://user:pass@host:4001, with the keystls,levelandfreshness(D141). Each call sends one statement. A query goes to/db/request, so a write withRETURNINGreturns its rows, and Exec goes to/db/execute(D142). The server binds each argument, positional or named (D143). - Types. A value has the Go type of the affinity of its declared type:
int64,float64,string,[]byteor a number. ABOOLEANis abool, aDATEadbimp.Date, aDATETIMEadbimp.LocalDateTimeand aTIMESTAMPatime.Time. SQLite lets a column hold a value of another storage class, and such a value keeps the Go type of its JSON form, such as astringin anINTEGERcolumn (D140). - Options.
WithTimeout,WithReadonly,WithParameter,WithLevelandWithFreshnessapply to one statement.WithReadonly(true)sends the statement to/db/query, which refuses a write, and needs only the permissionquery.WithDatabasefails, because rqlite has one database. - Timeouts. The deadline of the context goes to the server as
db_timeout, which stops a read and a write (D145).WithTimeoutalso ends the request at that time, because 9.4.5 ignoresdb_timeoutfor a read on/db/request(D146).
What a caller must know
BeginTxfails withdbimp.ErrNotSupported. rqlite runs every write of every client on one connection, so aBEGINwould be open for all of them (D144).RowsAffectedandLastInsertIdare 0 for a statement that is notINSERT,UPDATE,DELETE,REPLACEorWITH, because the server gives the counts of an earlier write for it (D142).- A string argument of the form
x'...'goes into the text as a literal, so that it stays text, because the server binds it as a BLOB (D143). - The server damages some values before they reach the driver: a BLOB of an expression, and a BLOB in the first row of a column with no declared type, arrive as text, and a
DATE,DATETIMEorTIMESTAMPwhose text does not parse arrives as the year 1.docs/RQLITE.mdlists each case.
Other changes
- The workflow pins dbmeta at
f7e3cbb, which starts rqlite with the URL of D141.