-
Notifications
You must be signed in to change notification settings - Fork 689
Open
Description
For tables with primary key constraints that had their data set using example_db.tables.example_table.data = []; , running an update statement is throwing an error for me. I'll attach pseudo-code below, and here's a link to an example on jsfiddle: https://jsfiddle.net/0wmhx149/15/
Updating data with no pk works fine:
// pseudo-code
a = new alasql.Database();
a.exec("create table with no pk");
a.tables.table.data = [ some data ] ;
a.exec("update table");
// update runs correctly
Updating data with pk works fine if using insert statements:
// pseudo-code
a = new alasql.Database();
a.exec("create table with no pk");
a.exec("insert some data");
a.exec("update table");
// update runs correctly
Updating data with pk and direct assignment fails
// pseudo-code
a = new alasql.Database();
a.exec("create table with pk");
a.tables.table.data = [ some data ] ;
a.exec("update table");
// update throws an error
The error is Something wrong with index on table
Two obvious workarounds are
- Don't use PKs
- Don't directly assign data
mathiasrw