atlasariga.io/atlas/sql/internal/sqltest Index | Files

package sqltest

import "ariga.io/atlas/sql/internal/sqltest"

Index

Functions

func Escape

func Escape(query string) string

Escape escapes all regular expression metacharacters in the given query.

func Rows

func Rows(table string) *sqlmock.Rows

Rows converts MySQL/PostgreSQL table output to sql.Rows. All row values are parsed as text except the "nil" and NULL keywords. For example:

+-------------+-------------+-------------+----------------+
| column_name | column_type | is_nullable | column_default |
+-------------+-------------+-------------+----------------+
| c1          | float       | YES         | nil            |
| c2          | int         | YES         |                |
| c3          | double      | YES         | NULL           |
+-------------+-------------+-------------+----------------+

Source Files

sqltest.go

Version
v0.32.0 (latest)
Published
Mar 10, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
1 month ago

Tools for package owners.