Boot configuration file – jsqldb.json
The server startup settings are contained in the jsqldb.json file.
Sample content of this file is show below
port: TCP port to connect to the server.
datadir: The default data directory, and also the location of the admin db
isolates: The number of v8 isolates to use. Recommended to be the number of CPU cores.
max_query_threads: Max size of query threadpool to grow to.
passwordBCryptWorkfactor: BCrypt work factor for password hashes.
Users with admin priviledges can call admin functions through the normal query interface. There is a reserved db name “dbadmin” for this purpose, with defined admin functions attached.
When a server is started for the first time, and no users are created yet, the server is in open mode.
That means no username and password is required to connect to the database. So connection takes the following form:
To create a user, use the following dbadmin function:
The first user created will automatically be the root user. Once the first user is created, login without username and password will no longer work. Be sure to remember the root password. Further users may now be created, and rights assigned to them.
User will then connect using the following form
Delete a user as follows
A new user by default has full (root) access. Assign rights as follows:
Rights can contain any of the following:
query, listusers, createuser, deleteuser, listrights, setrights, createdb, forgetdb, dropdb, listdbs, root
So a non admin user should typically have query only. For all rights set to root.
List a users rights:
To create a database use the following call, using a user with the appropriate access rights:
The database will be created under the datadir. To create a database in another location, the path may be specified. (The path must be the full path, typically datadir/dbname)
If database files already exist from another installation, they can be mounted and added to the dbconfig using the createdb call as well. A database can be unmounted using
or totally deleted using
List all dbs