• SQLite

    From John Dovey@VERT/GATOFUEG to All on Fri Jun 11 20:43:38 2021
    I'm not sure if this is doable, so I was wondering if, before I dive down the rabbit-hole, someone else has some idea.ãI want to write something and access some SQLite data from within the js. Something like this:ã=Start=ã var sqlite3 = require('sqlite3').verbose();ãvar db = new sqlite3.Database(':memory:');ããdb.serialize(function() {ã db.run("CREATE TABLE lorem (info TEXT)");ãã var stmt = db.prepare("INSERT INTO lorem VALUES (?)");ã for (var i = 0; i < 10; i++) {ã stmt.run("Ipsum " + i);ã }ã stmt.finalize();ãã db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {ã console.log(row.id + ": " + row.info);ã });ã});ããdb.close();ãã=end=ããAny suggestions?ããThanksãJDã---ã* El Gato de Fuego (The Fire Cat) 4:920/69 * Pedasi, Panamaãã... HE has not a single redeeming defect.ã---ã þ Synchronet þ El Gato de Fuego - Pedasi, Panama - gatofueg.synchro.netã
  • From Ragnarok@VERT/DOCKSUD to John Dovey on Sat Jun 12 13:34:23 2021
    El 11/6/21 a las 22:43, John Dovey escribió:
    I'm not sure if this is doable, so I was wondering if, before I dive down the rabbit-hole, someone else has some idea.
    I want to write something and access some SQLite data from within the js. Something like this:
    =Start=
    var sqlite3 = require('sqlite3').verbose();
    var db = new sqlite3.Database(':memory:');

    db.serialize(function() {
    db.run("CREATE TABLE lorem (info TEXT)");

    var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
    for (var i = 0; i < 10; i++) {
    stmt.run("Ipsum " + i);
    }
    stmt.finalize();

    db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
    console.log(row.id + ": " + row.info);
    });
    });

    db.close();

    hi John, several year ago i wrote a simple patch to sbbs code to get
    sqlite databases object in JS (very very very simple)
    the patch is out of date now, but maybe you can patch against to actual
    git code. Its no for production environment, just a test.

    http://downloads.bbs.docksud.com.ar/sync/js_sqlite/

    if i get free time maybe i try patching over current code.

    Saludos!

    ---
    ï¿­ Synchronet ï¿­ Dock Sud BBS TLD 24 HS - bbs.docksud.com.ar
  • From Boondock@VERT/ELGATO to Ragnarok on Sat Jun 12 18:16:12 2021
    Re: Re: SQLiteã By: Ragnarok to John Dovey on Sat Jun 12 2021 13:34:23ãã Ra> hi John, several year ago i wrote a simple patch to sbbs code to get ã Ra> sqlite databases object in JS (very very very simple)ã Ra> the patch is out of date now, but maybe you can patch against to actual ã Ra> git code. Its no for production environment, just a test.ã Ra> if i get free time maybe i try patching over current code.ããThat looks fantastic, thank you. I will give that a try on my *crash+burn* server. ããFor the production one, I'm going to try exec an external program to handle database reading and update. We'll see how it goes.ããAll the bestãJohnã--- ãBoonDock ãaka John Dovey ã ã ãã... Genius is one per cent inspiration and ninety-nine per cent perspiration.ã---ã þ Synchronet þ Sent from El Gato de Fuego * The Fire Cat * elgato.synchronetbbs.orgã
  • From Tracker1@VERT/TRN to Ragnarok on Sun Jun 27 14:54:10 2021
    On 6/12/2021 9:34 AM, Ragnarok wrote:

    hi John, several year ago i wrote a simple patch to sbbs code to get
    sqlite databases object in JS (very very very simple)
    the patch is out of date now, but maybe you can patch  against to actual git code. Its no for production environment, just a test.

    http://downloads.bbs.docksud.com.ar/sync/js_sqlite/

    if i get free time maybe i try patching over current code.

    It would be really nice to be able to access SQLite shared databases via SynchroNet... I'm fond of the better-sqlite npm package myself for Node.
    --
    Michael J. Ryan - tracker1@roughneckbbs.com
    ---
    ï¿­ Synchronet ï¿­ Roughneck BBS - roughneckbbs.com