Creating table with inserting default rows #362
-
For example; I want to create a {
name: "options",
columns: {
id: {primaryKey: true, autoIncrement: true},
key: {dataType: "string", notNull: true},
value: {dataType: "string", notNull: true}
},
values: [
{
key: "color",
value: "red"
},
{
key: "limit",
value: 10
}
]
} I also want to be able to do this when upgrading the db version, not only when creating a table. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Creating a table and inserting data into table are two different process. So you need to write two query for it.
JsStore returns
You can also check for db version to insert or update data based on particular version. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the answer.
I didn't know it. Checking db version is good idea for me 👍 |
Beta Was this translation helpful? Give feedback.
Creating a table and inserting data into table are two different process. So you need to write two query for it.
JsStore returns
true
when you create or update the db schema.