bobgen-psql

command
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 11 Imported by: 0

README

Bob Gen for Postgres

Generates an ORM based on a postgres database schema

Usage

PSQL_DSN=postgres://user:pass@host:port/dbname go run github.com/stephenafamo/bob/gen/bobgen-psql@latest
Driver Configuration

The configuration for the postgres driver must all be prefixed by the driver name.
You must use a configuration file or environment variables for configuring the database driver;
there are no command-line options for providing driver-specific configuration.

In the configuration file for postgresql for example you would do:

psql:
  dsn: "postgres://user:pass@host:port/dbname"

When you use an environment variable it must also be prefixed by the driver name:

PSQL_DSN="postgres://user:pass@host:port/dbname"

The values that exist for the drivers:

Name Required Postgres Default
schema no "public"
dsn yes none
whitelist no []
blacklist no []

Example of whitelist/blacklist:

psql:
    # Removes migrations table, the name column from the addresses table, and
    # secret_col of any table from being generated. Foreign keys that reference tables
    # or columns that are no longer generated because of whitelists or blacklists may
    # cause problems.
    blacklist: ["migrations", "addresses.name", "*.secret_col"]

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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