You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
2.0 KiB
133 lines
2.0 KiB
= LabInstance nodesqlite3!
|
|
|
|
|
|
== Quickstart
|
|
|
|
This is a quickstart guide of howto use this *LabInstance*
|
|
|
|
=== Default Configuration
|
|
|
|
- Working Directory
|
|
|
|
> /usr/local/node-sqlite3/node-sqlite3
|
|
|
|
- Default user
|
|
|
|
> docker
|
|
|
|
- Default password
|
|
|
|
> docker
|
|
|
|
- Default password4root
|
|
|
|
> pass
|
|
|
|
|
|
== LabInstance Info
|
|
|
|
Asynchronous, non-blocking SQLite3 bindings for Node.js.
|
|
|
|
|
|
Supported platforms
|
|
|
|
|
|
The sqlite3 module works with:
|
|
|
|
Node.js v11.x, v12.x, v13.x and v14.x.
|
|
Electron v6.0.x, v6.1.x, v7.0.x, v7.1.x, v8.0.x, v8.1.x and v8.2.x
|
|
|
|
The sqlite3 module provides a rich set of features:
|
|
|
|
- Simple API for query execution
|
|
- Parameters binding support
|
|
- Control the query execution flow, supporting both serialized and parallel modes.
|
|
- Comprehensive debugging support
|
|
- Full caching / Blob support
|
|
- SQLite extension support
|
|
- Bundles SQLite as a fallback
|
|
|
|
See the API documentation: https://github.com/mapbox/node-sqlite3/wiki[^]
|
|
|
|
Usage Example
|
|
|
|
[source,bash]
|
|
----
|
|
var sqlite3 = require('sqlite3').verbose();
|
|
var db = new sqlite3.Database(':memory:');
|
|
|
|
db.serialize(function() {
|
|
db.run("CREATE TABLE lorem (info TEXT)");
|
|
|
|
var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
|
|
for (var i = 0; i < 10; i++) {
|
|
stmt.run("Ipsum " + i);
|
|
}
|
|
stmt.finalize();
|
|
|
|
db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
|
|
console.log(row.id + ": " + row.info);
|
|
});
|
|
});
|
|
|
|
db.close();
|
|
----
|
|
|
|
== More info
|
|
|
|
https://en.wikipedia.org/wiki/Debian[^]
|
|
|
|
|
|
== RUN INSTANCE
|
|
|
|
Swarmlab services can be run in different ways.
|
|
|
|
- You can run them **through the swarmlab hybrid environment** (http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs/swarmlab/docs/hybrid/start-microservices.html)
|
|
- or use them individually at will on the **command line of your system**
|
|
|
|
|
|
=== CLI
|
|
|
|
> git clone ...
|
|
|
|
> cd [DIRECTORY]
|
|
|
|
|
|
=== help
|
|
|
|
> make help
|
|
|
|
|
|
==== create service
|
|
|
|
> make create
|
|
|
|
|
|
=== start service
|
|
|
|
> make start
|
|
|
|
|
|
=== stop service
|
|
|
|
> make stop
|
|
|
|
|
|
=== list service
|
|
|
|
> make list
|
|
|
|
|
|
=== clean service
|
|
|
|
> make clean
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|