Skip to content

Ability to use different schema without prefixingΒ #951

Open
@captainjapeng

Description

@captainjapeng

If you're having a generation problem please answer these questions before submitting your issue. Thanks!

What version of SQLBoiler are you using (sqlboiler --version)?

SQLBoiler v4.5.0

What is your database and version (eg. Postgresql 10)

Postgresql 12.6

If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)

output = "pkg/storage/psql/models"
no-tests = true
[psql]
	dbname 		= "test-database"
	schema 		= "test-database"
	host 		= "localhost"
	port 		= 5433
	user 		= "user"
	pass 		= "pass"
	sslmode 	= "disable"
	blacklist = ["migrations", "gorp_migrations"]

[[types]]
	[types.match]
		db_type = "uuid"
	[types.replace]
		type = "uuid.UUID"
	[types.imports]
		third_party = ['"github.com/gofrs/uuid"']

If this happened at runtime what code produced the issue? (if not applicable leave blank)

What is the output of the command above with the -d flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)

Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)

Using CrunchData's Postgresql operator, the database is provisioned under a different schema (based on the user's name)

 table_catalog | table_schema |     table_name     
---------------+--------------+--------------------
 test-database  | public       | pg_stat_statements
 test-database  | user          | table1
 test-database  | user          | table2
......

Further information. What did you do, what did you expect?

Running sqlboiler psql command generates commands with the schema named prefixed, I think there should be a way to disable this behavior as there could be a schema name difference between environments (local, staging, production).

Upon checking the implementation for prefixing, would it be okay if we expose this field via the config?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions