db

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

Database Support

Dependencies

  1. ent - insane entity mapping tool, definitely not an ORM but kind of an ORM
  2. atlas - Schema generation and migration
  3. entx - Wrapper to interact with the ent

Supported Drivers

  1. libsql
  2. sqlite
  3. postgres

Local Development

Config Examples
Libsql
  1. This will write to a local file dbx.db, already included in .gitignore
db:
  debug: true
  driver_name: "libsql"
  primary_db_source: "file:dbx.db"
  run_migrations: true
Sqlite
  1. This will write to a local file dbx.db, already included in .gitignore
db:
  debug: true
  driverName: sqlite3
  primaryDbSource: "dbx.db"
  runMigrations: true
Postgres
  1. Postgres is included in docker/docker-compose-pg.yml and the same instance can be used for development. The following connection string should work when using task docker:all:up
db:
  debug: true
  driverName: postgres
  primaryDbSource: "postgres://postgres:password@postgres:5432?sslmode=disable"
  runMigrations: true
Turso
  1. Replace the url with your turso database url and token
db:
  debug: true
  driverName: libsql
  primaryDbSource: "https://openlane-golanglemonade.turso.io?authToken=$TURSO_TOKEN"  # set TURSO_TOKEN to value
  runMigrations: false

Documentation

Overview

Package db provides an embedded filesystem containing all the database migrations

Index

Constants

This section is empty.

Variables

View Source
var GooseMigrationsPG embed.FS

GooseMigrationsPG contain an embedded filesystem with all the goose migration files for postgres

View Source
var GooseMigrationsSQLite embed.FS

GooseMigrationsSQLite contain an embedded filesystem with all the goose migration files for sqlite

View Source
var Migrations embed.FS

Migrations contain an embedded filesystem with all the sql migration files

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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