-
Notifications
You must be signed in to change notification settings - Fork 16
Idea: Use temp/virtual row for insert #70
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
Comments
Yeah, the insert functionality is very very basic. It should be expanded on. A parameter flag for a virtual row would work fine for the use case you suggested - though it might get tricky saving since it relies on updating a current record (an UPSERT could help remedy that though) |
UPSERT - You’re speaking new language to me. I have a lot to learn about sql. |
Update or Insert :) Create the row if it doesn't exist, otherwise create
it. Super cool, I wish it was more universally applied though (sqlite and
Postgres have an upsert with ON CONFILCT...DO UPDATE that can be used in
conjunction with INSERT, in MySQL you can do the same with ON DUPLICATE KEY
UPDATE that can be used in conjunction with INSERT, Oracle has an actual
UPSERT command, in MS SQL Server you have to do some tricks with IF NOT
EXISTS... )
My next big update will be some database abstraction so that I can start
adding other database engines :)
…On Wed, Feb 15, 2023 at 9:19 PM ssweber ***@***.***> wrote:
UPSERT - You’re speaking new language to me. I have a lot to learn about
sql.
—
Reply to this email directly, view it on GitHub
<#70 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQX2REQRQWQAE3UY5WQC56LWXWFCHANCNFSM6AAAAAAU5GWACQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Seems like abstract_database pretty much fixes this one. |
This relates to Unique/Not-Null fields.
It would be interesting to explore how to have an alternate insert - one that creates the row virtually, and only inserts on save, with validators automatically checking Not Null fields and uniqueness.
I don’t know how this would affect dynamic columns.
Behavior: click insert. Insert button inactive. New record/row appears. If you move away and don’t save, row is never saved.
The text was updated successfully, but these errors were encountered: