SimpleSQL is a complete SQL database accessible via HTTP API.
It is based on SQLite and allow to create a multitude of small databases.
(Consider that we run our front-end test against the live service and each test create a new database.)
The API is documented on swagger where it is possible to create a new database and execute commands and query against it. Don't worry it is free!
User without authentication can create and work only with public databases, for private databases is necessary to register and then the user will have access to authentication tokens.
Subscribe to the mail list
SimpleSQL is a growing project, you can subscribe to updates here.
The SDK is simple just like the API and it should be possible to understand it very quickly, especially if guided by the tests.
On server environments
npm i @redbearlab/simplesql.
In the browser environment is necessary to set the CORS headers to use the authentication/private databases.
The API is await/async first.
let new_public_database = await SimpleSQL.newDatabase(); let new_private_database = await SimpleSQL.newDatabase('your_token_here');
SimpleSQL.newDatabase([token]) create a new (private if you provide the token) database and returns its ID.
let result_public = await SimpleSQL.command(database_id, query); let result_private = await SimpleSQL.command(database_id, query, 'your_token_here');
SimpleSQL.command(database, command [, token] ) execute an SQL command against the database and return the results.
If you provide a token it is possible to execute commands also against the private databases create by the costumer.
let databases = await SimpleSQL.listDatabases('your_token_here');
SimpleSQL.listDatabases(token) returns all the databases of the costumer.
The command must be invoked with a token, it is not possible to list all the public databases.
let new_token = await SimpleSQL.newToken('your_token_here');
SimpleSQL.newToken(token) create a new token and return it.
The new token can be used to access all the databases created with the original token, to create new databases, or to create new tokens.
let tokens = await SimpleSQL.listTokens('your_token_here');
SimpleSQL.listTokens(token) returns a list of all the token associate with the account.
Each token can be used to create private databases, query private databases or create new tokens.
The biggest contribution is your feedback on the product and API.
Feel free to open an issue, a PR or send directly an email to firstname.lastname@example.org
If you want to contribute to the code, feel free to run the tests.
A dummy user with a dummy token is present in the tests, it can be used freely.