Repository navigation
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. |
Answered by
ujjwalguptaofficial
Feb 24, 2024
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. |
0 replies
Answer selected by
afbora
|
Thank you for the answer.
I didn't know it. Checking db version is good idea for me 👍 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creating a table and inserting data into table are two different process. So you need to write two query for it.
JsStore returns
truewhen you create or update the db schema.