bigpresh / bigpresh/Dancer-Plugin-SimpleCRUD
Support sequence names for primary key ids (will help PostgreSQL)
- Dominant language
- Perl
- Stars
- 26
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
Right now when "adding" a new row it attempts to insert a null value for the primary key. This works in MySQL when auto_increment is used. I would like to see support for a new argument (maybe called "sequence") that specifies which sequence to use to generate the primary key before the insert happens. This will help with PostgreSQL support.
In case you're not familiar with sequences the idea is that I can SELECT NEXTVAL('sequencename'); to grab the next available ID for a specific sequence. It's common for non-MySQL dbs to use sequences instead of auto_increment columns (yes I know Postgres has a "serial" option that does the same thing but I am not using it).
I may be able to work on a patch for this in the next week or so, just wanted to document it as a request.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the code path that adds a new row and currently inserts a null primary key, then inspect how database-specific behavior is handled. Confirm the proposed sequence argument and PostgreSQL NEXTVAL('sequencename') behavior, add coverage for generated IDs, and verify existing MySQL auto_increment behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, perl, postgresql
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100