Skip to content
Sign upLog in
← Back to Community
Node.js SQLite Database
Profile icon
KENNETHTRIPP

Ok, now that

@Coder100
helped me connect a Node.js server to HTML, CSS, and JS I need to connect Node.js to an SQLite database. I hope he knows how to do that too because I have absolutely no clue.
Also, I created a new post just for this just in case someone in the future needs help with just this and already knows how to use Node with HTML, CSS, and JS.

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
DerekLai
Profile icon
MoPaMo
Profile icon
Jareer12
Profile icon
Highwayman
Profile icon
KENNETHTRIPP
Comments
hotnewtop
Profile icon
Coder100

Yeah sure, I did play around with it a bit, and decided noSQL was cooler, but that's my opinion lol

so the most popular lib is unsurprisingly called sqlite3
https://www.npmjs.com/package/sqlite3

its docs are really good and the example in the front page is basically like all I ever used it for xd

if it doesn't compile then report to bugs
https://repl.it/bugs
it's really frustrating when a lot of these awesome C++ libraries aren't even available

Profile icon
KENNETHTRIPP

@Coder100
Ok, thanks!

Profile icon
Coder100
Profile icon
KENNETHTRIPP

@Coder100
One last question: Could I use sqlite3 in plain JavaScript? I know it wouldn't be secure or anything, but just hypothetically. Or would repl.it database be better?

Profile icon
Coder100

@KENNETHTRIPP
it might be secure if you know hashing, but there is a bigger bug than that: persistance

you see, to prevent abuse, if you are not on the repl, and it has been a certain amount of time, programmatic edits won't be saved.

Profile icon
KENNETHTRIPP

@Coder100
Ohhh, cause client side scripts don't run forever?

Profile icon
Highwayman

Also, I created a new post just for this just in case someone in the future needs help with just this and already knows how to use Node with HTML, CSS, and JS.

a million upvotes for YOU sir