@hypi/mekadb
v0.1.1
Published
Register a https://hypi.ai
Downloads
4
Readme
Hypi's MekaDB client
Register a https://hypi.ai
Usage
var mekadb = require('@hypi/mekadb');
let client = new mekadb.Client("mekadb.hypi.app", "<db>", "<username>", "<password>");
async function main() {
let createTableRes = await client.query('CREATE TABLE IF NOT EXISTS user(username VARCHAR, pass VARCHAR, PRIMARY KEY (username))');
console.log('Creat table res', createTableRes);
let insertRes = await client.query("INSERT INTO user(username,pass) VALUES('courtney','pass1'),('damion','pass2')")
console.log('Inserted data into table', insertRes);
let rows = await client.query("SELECT * FROM user");
console.log('ROWS:', rows)
}
let _ = main();
Building manually
Needed in Github action or locally.
npm install -g grpc-tools
cd ../protos
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:src/ --grpc_out=grpc_js:src/ ../../../proto/public-grpc-apis/mekadb_client.proto