-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
AFAIK, database-js-ini does not support UPDATE commands yet. One problem is probably the syntax.
Thus, I would like to suggest a syntax for that:
Update the ROOT
UPDATE ROOT SET foo = "bar"
UPDATE ROOT SET max = 1
would produce
foo=bar
max=1
only if the corresponding keys ("foo" and "max") exist.
Update a section
UPDATE `my section` SET foo = "bar"
UPDATE `my section` SET max = 1
would produce
[my section]
foo=bar
max=1
only if the section ("my section") and its corresponding keys ("foo" and "max") exist.
Update with restriction
UPDATE `my section` SET foo = "bar" WHERE foo = "zoo"
UPDATE `my section` SET max = 100, `new key` = "new value" WHERE max < 100
Note: Keys can be produced during UPDATE, like the "new key" above.
Removing a key
A key should be removed by setting its value to NULL.
UPDATE ROOT SET foo = null WHERE foo = "zoo"
UPDATE `my section` SET max = null WHERE max < 100
UPDATE `my section` SET foo = null, `other key` = null WHERE max < 100
Metadata
Metadata
Assignees
Labels
No labels