Skip to content

More Sqlite

Rhydderchc edited this page Feb 10, 2021 · 1 revision

Tabular Formats

If you've ever used sqlite or better-sqlite3, you've already noticed that you can make tables. Well, hive-db lets you create tables as well.

const table = new db.table('table');
table.init('foo', 'bar');
console.log(table.get('foo'));
// output -> bar!
// console.log(db.get('foo')); would provide null, in this case.
/**
*@params key string
*/

Array and Problems

Using arrays is particularly easy in Hive-db, although people do run into errors quite often. A quick example of what I mean:-

db.init('array', 'Rhydderchc');
db.input('array', 'Lason');
db.get('array');
// -> results in error
/*
While This, 
doesnt result in err ->
*/
db.init('array', ['Rhydderchc'])
db.input('array', 'Lason');
db.get('array');
// Results in Rhydderchc, Lason
Clone this wiki locally