How to create a new database in zeeSQL
To start using zeeSQL you need to create a database.
In zeeSQL you can have as many databases as necessary.
Each database you create in zeeSQL is an SQLite database, it can either be an in-memory database or a file-backed database.
Each database is associate with a Redis key.
Delete the key, and the database is deleted. If the database is backed by a file, then the file is closed, but it is not deleted.
To create a database, you can use the command ZEESQL.CREATE_DB
In this way a new in-memory database is created, it is associated with the DB
key in Redis.
In-memory databases will always be created empty in zeeSQL.
To create a database-backed by a file, you need to pass the PATH
flag.
The FILE_DB
database, will be associate with an SQLite database stored in disk, in the file file.sqlite
.
Please note that databases stored in disk have different performances than the databases stored in memory. Usually slower.
Importing an external database
Sometimes you may want to import some data from some other source.
zeeSQL allows you to load any SQLite database.
Suppose you already have an SQLite database that contains your users, and that you saved it in users.sqlite
.
To import that database inside zeeSQL you only need to:
About zeeSQL
zeeSQL is a Redis Module that provides SQL capabilities to Redis. It allows the creation and management of several SQL databases, each one independent from the other. Moreover, zeeSQL provides out-of-the-box secondary indexes capabilities, allowing fast and easy search by value in Redis.
Last updated