Replies: 1 comment 3 replies
-
In |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Almost 8 years ago, there was this:
https://stackoverflow.com/questions/39589899/how-to-use-postgres-sequences-with-sequel
but more recently:
https://www.rubydoc.info/gems/sequel-sequence
The examples in the latter all relate to migrations (which i'm not doing). I was able to put a call to: 'DB.create_sequence :id' into my model (which is probably wrong) and a 'Sequence "public.id" was created (as a Postgres 'bigint'). I already have 'primary_key :id' in the model, but, after running, the two are (unsurprisingly) not related. I want my 'id' field to be a sequence and the primary key, but don't know how to accomplish this. Also, creating a new record (Album.create... using DataMapper) automatically incremented the :id field, but i'm thinking this might not happen with Sequel and i'll have to call DB.nextval("id")... somewhere. But to have this happen automagically when i create a new record...? As always, any help is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions