Giter Club home page Giter Club logo

database-js-ini's People

Contributors

mlaanderson avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

thiagodp

database-js-ini's Issues

Support UPDATE

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

Support INSERT

AFAIK, database-js-ini does not support INSERT commands yet. One problem is probably the syntax.

Thus, I would like to suggest a syntax for that:

Insert into the ROOT

INSERT INTO ROOT VALUES ( "foo", "bar" )
INSERT INTO ROOT VALUES ( "max", 1 )

would produce

foo=bar
max=1

Insert into a section

INSERT INTO `my section` VALUES ( "foo", "bar" )
INSERT INTO `my section` VALUES ( "max", 1 )

would produce

[my section]
foo=bar
max=1

Notes:

  • Section is created if not exists.
  • Values are overwritten if exist.

Support DELETE

AFAIK, database-js-ini does not support DELETE commands yet. One problem is probably the syntax.

Thus, I would like to suggest a syntax for that:

Delete from the ROOT

DELETE FROM ROOT

would remove all the sections and keys from the file.

Delete a section

DELETE FROM `my section`

would remove the section "my section".

DELETE FROM `my section` WHERE max < 100

would only remove the section "my section" if "max" is less than 100.

Notes

  • Keys can be removed with the UPDATE method, setting their value to NULL.
    For example:
    UPDATE `my section` SET max = null WHERE max < 100
    would remove the key "max" if its current value is less than 100.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.