Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

An atom-blaster is a good weapon, but it can point both ways. -- Isaac Asimov


dovenet / Synchronet Javascript / Re: SQLite

SubjectAuthor
* SQLiteJohn Dovey
`* Re: SQLiteRagnarok
 +- Re: SQLiteBoondock
 `- Re: SQLiteTracker1

1
SQLite

<60C4114A.15.dove-syncjs@gatofueg.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=601&group=DOVE-Net.Synchronet_Javascript#601

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: john.dovey@VERT/GATOFUEG (John Dovey)
To: All
Subject: SQLite
Message-ID: <60C4114A.15.dove-syncjs@gatofueg.synchro.net>
Date: Fri, 11 Jun 2021 13:43:38 -0500
X-Comment-To: All
Path: rocksolidbbs.com!not-for-mail
Organization: El Gato de Fuego II
Newsgroups: DOVE-Net.Synchronet_Javascript
X-FTN-PID: Synchronet 3.19a-Win32 master/064fb683a May 25 2021 MSC 1928
X-FTN-CHRS: CP437 2
WhenImported: 20210611184413-0700 c1e0
WhenExported: 20210611204309-0700 c1e0
ExportedFrom: VERT sync-js 3494
WhenImported: 20210611204338-0500 412c
WhenExported: 20210611204401-0500 412c
ExportedFrom: GATOFUEG dove-syncjs 15
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: John Dovey - Fri, 11 Jun 2021 18:43 UTC

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

Re: SQLite

<60C4E20F.3423.dovenetsyncprjs@bbs.docksud.com.ar>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=602&group=DOVE-Net.Synchronet_Javascript#602

  copy link   Newsgroups: DOVE-Net.Sync_JavaScript DOVE-Net.Synchronet_Javascript
From: ragnarok@VERT/DOCKSUD (Ragnarok)
To: John Dovey
Subject: Re: SQLite
Message-ID: <60C4E20F.3423.dovenetsyncprjs@bbs.docksud.com.ar>
Date: Sat, 12 Jun 2021 06:34:23 -0300
X-Comment-To: John Dovey
Path: rocksolidbbs.com!not-for-mail
Organization: Dock Sud BBS
Newsgroups: DOVE-Net.Sync_JavaScript,DOVE-Net.Synchronet_Javascript
In-Reply-To: <60C4114A.15.dove-syncjs@gatofueg.synchro.net>
References: <60C4114A.15.dove-syncjs@gatofueg.synchro.net>
X-FTN-PID: Synchronet 3.19a-Linux master/a2110bfca Jun 9 2021 GCC 6.3.0
X-FTN-CHRS: UTF-8 4
WhenImported: 20210612100623-0700 c1e0
WhenExported: 20210612144316-0700 c1e0
ExportedFrom: VERT sync-js 3495
WhenImported: 20210612133423-0300 ff4c
WhenExported: 20210612140619-0300 ff4c
ExportedFrom: DOCKSUD dovenetsyncprjs 3423
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101Firefox/78.0 Thunderbird/78.11.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: es-AR
Content-Transfer-Encoding: 8bit
 by: Ragnarok - Sat, 12 Jun 2021 09:34 UTC

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

Re: SQLite

<60C4F9EC.14.dove-syncjs@elgato.synchronetbbs.org>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=603&group=DOVE-Net.Synchronet_Javascript#603

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: boondock@VERT/ELGATO (Boondock)
To: Ragnarok
Subject: Re: SQLite
Message-ID: <60C4F9EC.14.dove-syncjs@elgato.synchronetbbs.org>
Date: Sat, 12 Jun 2021 11:16:12 -0500
X-Comment-To: Ragnarok
Path: rocksolidbbs.com!not-for-mail
Organization: El Gato de Fuego
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <60C4E20F.3423.dovenetsyncprjs@bbs.docksud.com.ar>
References: <60C4E20F.3423.dovenetsyncprjs@bbs.docksud.com.ar>
X-FTN-PID: Synchronet 3.18c-Linux master/113a9a5 Feb 17 2021 GCC 5.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20210612111803-0700 c1e0
WhenExported: 20210612144316-0700 c1e0
ExportedFrom: VERT sync-js 3496
WhenImported: 20210612181612-0500 412c
WhenExported: 20210612181762Z 412c
ExportedFrom: ELGATO dove-syncjs 14
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Boondock - Sat, 12 Jun 2021 16:16 UTC

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

Re: SQLite

<60D8F384.544.dove-syncjs@roughneckbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=604&group=DOVE-Net.Synchronet_Javascript#604

  copy link   Newsgroups: DOVE-Net.Sync_JavaScript DOVE-Net.Synchronet_Javascript
From: tracker1@VERT/TRN (Tracker1)
To: Ragnarok
Subject: Re: SQLite
Message-ID: <60D8F384.544.dove-syncjs@roughneckbbs.com>
Date: Sun, 27 Jun 2021 07:54:10 -0700
X-Comment-To: Ragnarok
Path: rocksolidbbs.com!not-for-mail
Organization: Roughneck BBS
Newsgroups: DOVE-Net.Sync_JavaScript,DOVE-Net.Synchronet_Javascript
In-Reply-To: <60C4E20F.3423.dovenetsyncprjs@bbs.docksud.com.ar>
References: <60C4E20F.3423.dovenetsyncprjs@bbs.docksud.com.ar>
X-FTN-PID: Synchronet 3.18c-Linux HEAD/0634130 Mar 14 2021 GCC 6.3.0
X-FTN-CHRS: UTF-8 4
WhenImported: 20210627160800-0700 c1e0
WhenExported: 20210627204320-0700 c1e0
ExportedFrom: VERT sync-js 3497
WhenImported: 20210627215412Z 0000
WhenExported: 20210627230757Z 0000
ExportedFrom: TRN dove-syncjs 544
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101Thunderbird/78.10.2
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
 by: Tracker1 - Sun, 27 Jun 2021 14:54 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor