Help us shape the future of Go! Take the 2026 Go Developer Survey

mysql_devserver

package
v0.57.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package mysql_devserver serves an in-memory Spacewave SQL database over the MySQL wire protocol, so a build-time tool that types queries by preparing them, such as Reylo, asks the same engine a Space's sql/db objects run on.

Index

Constants

View Source
const SchemaFileSuffix = ".sql"

SchemaFileSuffix ends the name of each schema file a directory contributes.

Variables

This section is empty.

Functions

func ReadSchemaFiles

func ReadSchemaFiles(paths []string) (files []string, texts []string, err error)

ReadSchemaFiles reads the SQL schema at each path in order. A directory contributes its .sql files sorted by name, the order migration files are numbered in; subdirectories are not read. Returns the files read and their texts, in the same order.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a running dev SQL endpoint. Its database is built once from the schema and read-only afterwards: it answers prepares and catalog reads, and any statement that writes fails.

func Start

func Start(ctx context.Context, lis net.Listener, dbName string, schema []string) (*Server, error)

Start builds database dbName from the schema statements and serves it on lis until Close. It takes ownership of lis.

func (*Server) Close

func (s *Server) Close() error

Close stops the server, waits for it to stop serving, and releases the database.

func (*Server) URL

func (s *Server) URL() string

URL returns the endpoint as a mysql:// URL naming the database, the form DATABASE_URL takes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL