-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for enums schema in Postgresql #1171
Comments
realaravinth
added a commit
to realaravinth/gitpad
that referenced
this issue
Feb 14, 2022
…thods The following changes are implemented for both db-sqlx-postgres and db-sqlx-sqlite: TABLE gists_gists Stores gist metadata with unique index on gists_gists.public_id for fast lookups TABLE gists_comments Stores comment metadata TABLE gists_privacy Stores gist privacy: sqlx currently doesn't have support Postgres enums(ref: launchbadge/sqlx#1171), so storing possible privacy values as references from this table. This table shouldn't be mutated during runtime. Possible values are already recorded in database during migrations. All runtime operations on this table must only take references. Each implementation of GistDatabase also includes a method called privacy_exists, which is called during tests to ensure that migrations are successful. VIEW gists_gists_view Gist lookups combines data from gists_users, gists_gists and gists_privacy. This SQL view boots performance(I think?). At any rate, it is much nicer to work with. QUIRKS Database indexes are i64 in SQLite while i32 in Postgres
realaravinth
added a commit
to realaravinth/gitpad
that referenced
this issue
Feb 14, 2022
…thods The following changes are implemented for both db-sqlx-postgres and db-sqlx-sqlite: TABLE gists_gists Stores gist metadata with unique index on gists_gists.public_id for fast lookups TABLE gists_comments Stores comment metadata TABLE gists_privacy Stores gist privacy: sqlx currently doesn't have support Postgres enums(ref: launchbadge/sqlx#1171), so storing possible privacy values as references from this table. This table shouldn't be mutated during runtime. Possible values are already recorded in database during migrations. All runtime operations on this table must only take references. Each implementation of GistDatabase also includes a method called privacy_exists, which is called during tests to ensure that migrations are successful. VIEW gists_gists_view Gist lookups combines data from gists_users, gists_gists and gists_privacy. This SQL view boots performance(I think?). At any rate, it is much nicer to work with. QUIRKS Database indexes are i64 in SQLite while i32 in Postgres
Please implement this |
8 tasks
how is it going? |
Any updates? |
It looks like this was fixed in #3252 ? |
Yep, if anyone still has a problem feel free to open a new issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
As far as I can tell, right now it's impossible to use enums in schema other then public.
It would be very helpful if one could specify schema as well, perhaps like this:
The text was updated successfully, but these errors were encountered: