Useful Tip:
You can use this simple web admin database management to testing your query examples.
Welcome , The MIRA-DB It is open source (OOJSDB) distributed free of charge under the terms of the MIT License.
Download (@last-stable Releases) for Your Preferred Platform.
Windows, Mac, Arm, and various Linux distributions are supported (cross platform) , each both 32 and 64 bit.
Please select your system architecture or Installer.
sudo mkdir /home/miradb
cd /home/miradb
sudo wget https://github.com/Nodeclient/Mira-DB/releases/download/linux/miradb-x64-1.0.30.tar
sudo tar xvzf miradb-x64-1.0.30.tar
sudo chmod 777 miradb
sudo chmod 777 service
sudo chmod 777 run
sudo ./service
sudo rm miradb-x64-1.0.30.tar
you need to first switching to the (root) user before start miradb.
miradb (start | stop | restart)
MIRA QUERY (GET,POST) : http://localhost:8123/query
PUBLIC HTTP : http://localhost:8123/
Install the dependencies in the local node_modules folder
// IMPORT MODULE
const mira = require("mira-db");
// YOUR APP PERMISSION
var Perms = { SELECT:true,ADD:true,UNIQUE:true,UPDATE:true,RENAME:true,DROP:true,DELETE:true,CREATE:true,LIST:true }
// DATABASE STORAGE FOLDER
var Storage = __dirname + "/data";
// DATABASE NAME
var DB = "test";
// CREATE NEW MIRA-DB OBJECT
var new_database = new mira(Storage,DB,Perms,"UTF-8");
//SET QUERY
var query = 'SELECT TABLE person'
// RESULT (RETURN EXAMPLE)
var result = new_database.Query(query);
console.log( result );
// RESULT (CALLBACK EXAMPLE)
new_database.Query(query ,function(result){
console.log( result );
});
Your Database server can be managed by multiple users. You can control each user's role, as well as control the scope of their MiraQuery access and their specific permission levels for that query access.
please visit installation directory to set configure files
Default (linux) : /home/miradb/
Default (windows) : c:/miradb/
Take a look at the following example configs :
USER SETTING
USER_NAME:
# [STRING] "white spaces" or "null" not allowed #
PASSWORD:
# [STRING] white spaces not allowed #
# use "null" for disable password on remote login #
PERMISSION_FILE_NAME:
# [STRING] white spaces not allowed #
# enter your permission file name | admin.perm -> "admin" #
DATABASE_NAME:
# [STRING] white spaces not allowed #
# use "*" for multiple access #
# Example : "single" database access #
<root:null:yourperm:MyDatabase>
# Example : "multiple" database access #
<admin:1234:youraccess:*>
MiraQuery is a standard regular expression for storing, manipulating and retrieving data in databases. Our Querie tutorial will teach you how to use MiraQuery (let's beginning)
You can use this simple web admin database management to testing your query examples.
returns a dataset that contains only one observation for each unique combination of values for the strings in A specified in column.
UNIQUE COLUMN <COLUMN_NAME> TABLE <TABLE_NAME>;
db.query("UNIQUE COLUMN pass TABLE user",function(data,err){
console.log(data);
});
SELECT TABLE <TABLE_NAME>;
SELECT TABLE <TABLE_NAME> COUNT;
SELECT TABLE <TABLE_NAME> COLUMN [COLUMN_NAME];
SELECT TABLE <TABLE_NAME> LIMIT [START_NUMBER,END_NUMBER];
SELECT TABLE <TABLE_NAME> COLUMN [COLUMN_NAME] FIND ["SEARCH_STRING"];
SELECT TABLE <TABLE_NAME> COLUMN [COLUMN_NAME] FIND ["SEARCH_STRING"] LIKE;
the returned all the columns from the table
db.query("SELECT TABLE user;",function(data,err){
console.log(data);
});
UPDATE ROW <TABLE_NAME> COLUMN [COLUMN_NAME] VALUE [STRING] FIND [COLUMN_NAME,"STRING"];
used to modify the existing records in a table.
db.query("UPDATE ROW user COLUMN ["user","pass","mail"] VALUE ["olivia","3333","olivia@example.com"] FIND ["user","mason"];",function(data,err){
console.log(data);
});
ADD ROW COLUMN [COLUMN_NAME] VALUE [STRING];
ADD COLUMN [COLUMN_NAME] TABLE <TABLE_NAME>;
insert new record in a data table.
db.query("ADD ROW COLUMN ["user","pass","mail"] VALUE ["arvin","6666","arvin@example.com"];",function(data,err){
console.log(data);
});
RENAME TABLE ["TABLE_NAME"] VALUE ["NEW_TABLE_NAME"];
RENAME DATABASE ["DATABASE_NAME"] VALUE ["NEW_DATABASE_NAME"];
RENAME COLUMN ["COLUMN_NAME"] TABLE <TABLE_NAME> VALUE ["STRING"];
to rename a table in data.
db.query("RENAME TABLE ["user"] VALUE ["login"]",function(data,err){
console.log(data);
});
DELETE COLUMN [COLUMN_NAME] TABLE <TABLE_NAME>;
DELETE ROW <TABLE_NAME> COLUMN <COLUMN_NAME> VALUE ["SEARCH_STRING"];
DELETE ROW <TABLE_NAME> INDEX <INDEX_NUMBER>;
to delete a column in table
db.query("DELETE COLUMN ["mail"] TABLE user;",function(data,err){
console.log(data);
});
CREATE TABLE <TABLE_NAME> COLUMN ["COLUMN_NAME"] VALUE ["STRING"];
CREATE DATABASE <DATABASE_NAME>;
create a new table in a database
db.query("CREATE TABLE user COLUMN ["user","pass","mail"] VALUE ["mason","1234","mason@example.com"];",function(data,err){
console.log(data);
});
return value (success=true) (Failed=false)
DROP TABLE <TABLE_NAME>;
DROP DATABASE <DATABASE_NAME>;
to delete a table
db.query("DROP TABLE user;",function(data,err){
console.log(data);
});
return value (success=true) (Failed=false)
LIST DATABASE;
LIST TABLE <DATABASE_NAME>;
to delete a table
db.query("LIST TABLE PERSON;",function(data,err){
console.log(data);
});
return value (success=true) (Failed=false)
first, install dependencies in your local node_modules folder
//MIRA-DB NODEJS CLIENT
//Connector
const MiraDB = require("./nodejs_express_connector");
//Miradb object
var db = new MiraDB("root","","http://localhost:8123/query","test");
//MiraQuery
db.query("select table test",function(data,err){
console.log(data);
});
Download JS Connector
Download Source [Archive]
Simple admin database management tool that allows you to manage databases, tables, columns, indexes, and more from a web-based user interface.
PUBLIC HTTP : http://localhost:8123/
cd /home/miradb/public
sudo wget https://github.com/Nodeclient/Mira-DB/releases/download/webadmin/public_web_admin_102.tar.gz
sudo tar xvzf public_web_admin_102.tar.gz
sudo rm public_web_admin_102.tar.gz
This database tutorial will help beginners understand the basics of Mira database management systems.
View Youtube Channel