Documentation
¶
Overview ¶
Package mysql is the MySQL and MariaDB driver for Anetos's db package, using github.com/go-sql-driver/mysql.
database, err := db.Connect(ctx, app, mysql.Driver())
The connection is built from DB_HOST, DB_PORT (default 3306), DB_DATABASE, DB_USERNAME and DB_PASSWORD, or taken from DB_URL in the driver's DSN format (user:password@tcp(host:3306)/app?tls=true). Either way, times are read as time.Time in UTC (parseTime=true, loc=UTC), and updates report the rows they matched (clientFoundRows=true), which the db package relies on. Sessions use UTC (time_zone='+00:00') unless the DSN sets time_zone. Built from DB_HOST, the connection uses TLS as DB_TLS says (db.Config.TLSMode): verified for any host but this machine's, unless DB_TLS=skip-verify or none.
For vector search on MariaDB 11.7+, each session sets mhnsw_ef_search to 1000 (MariaDB's default is 20), so a vector index returns the candidates the query builder asks for (db.SimilarCandidates) even when the query's conditions keep few of the chunks it visits. It applies to the app's own vector queries too; MySQL and older MariaDB ignore it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.