Documentation
¶
Overview ¶
Package d1driver implements database/sql over a Cloudflare D1 binding. D1 exposes SQLite integers as JavaScript numbers. Values outside the safe integer range (-(2^53-1) through 2^53-1) are rejected to avoid rounding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrReadInTx marks a query in a buffered D1 transaction. D1 cannot provide // an interactive read-then-write transaction. ErrReadInTx = errors.New("d1driver: query inside a buffered transaction is not supported") // ErrDeferredResult marks result fields that are unavailable before a batch commits. ErrDeferredResult = errors.New("d1driver: result is deferred until the transaction commits") // ErrUnsafeInteger marks an integer that JavaScript cannot represent exactly. ErrUnsafeInteger = errors.New("d1driver: integer exceeds JavaScript's safe integer range") )
Functions ¶
func NewConnector ¶
NewConnector creates a database/sql connector around a D1 binding.
Types ¶
type BatchResult ¶
BatchResult is the D1 outcome of one statement after its batch has committed.
func BatchResults ¶
BatchResults sends statements in one D1 batch and collects metadata and rows for statements marked Returning.
func BatchResultsDB ¶
BatchResultsDB gets the D1 binding from a pooled database/sql connection and executes one native batch, bypassing database/sql's deferred transaction results.