db

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DriverName added in v1.2.1

func DriverName(name string) string

DriverName maps the dialect-style names accepted in .quark.yml (and by `quark init --dialect`) to the database/sql driver names actually registered in this binary. `quark init` writes `driver: postgresql`, but the registered PostgreSQL driver is pgx, so passing the config value straight to sql.Open fails with `unknown driver "postgresql"`. Unknown names pass through untouched so custom drivers keep working.

func GetAdminQuarkClient

func GetAdminQuarkClient() (*quark.Client, error)

func GetQuarkClient

func GetQuarkClient() (*quark.Client, error)

func GetTenantQuarkClient added in v1.2.2

func GetTenantQuarkClient(tenantID string) (*quark.Client, error)

GetTenantQuarkClient opens a client connected to ONE tenant's database. It exists so `quark tenant migrate`/`migrate-all` operate on the tenant the caller named instead of silently migrating the default database (QK-P1-3).

Only the db_per_tenant strategy is resolvable from static CLI config: the DSN comes from `tenant.dsn_template`, with the literal `{tenant}` replaced by the (already validated) tenant id. schema_per_tenant migrations need a TenantRouter wired to your models, which a standalone binary cannot build — that path returns an explicit error rather than a wrong-database migration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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