Open marcprux opened 6 years ago
Hey Marc,
I was having a bike ride today, and thinking about our Perl DBI modules and how easy it is to use the same library to use for dozens of DBD's. One of them even being CSV files.
CSV files do not have indexes, no primary keys, and no schema's or foreign keys.
And now you think: "but Splice doesn't support CSV databases", but I'd like too.
Which brings me to a whole new topic ...
Splice is dead ? can it be revived ?
Splice uses updatable result sets to perform updates and inserts. However, many database drivers disallow result set modification under various circumstances, such as when there is no primary key in the results. For example, if you try to insert a new record in MySQL on a table that doesn't contain a primary key, you will get the error:
Splice should either identify these scenarios and fallback to attempting the insert using old-fashioned
INSERT
statements.Updating is trickier, because while we could update based on the values of all the columns, this could in theory update more than one row, since without any primary keys, there is no guarantee of uniqueness. However, this seems to be what most other SQL database client apps do, so this might be the best route, possibly after first presenting the user with a warning that multiple rows may wind up being updated.