Host SQL database on repl.it
How would I host a SQL database on a SQLite repl, and access it from JS on another repl?
@Coder100 Sorry, if I was not clear, but I was wondering how I can connect to the database from a different repl. Also, I'm using vanilla JS. I'm making a website and need SQL.
you would have to use sqlite3 to use write and parse binary data, and a sqlite3 repl is basically a database sandbox, so they aren't really useful for a full-blown database. @CodeLongAndPros
@Coder100
Necroposting but what you could do, if it's entirely internal, is make a flask that accepts requests and runs those sql commands.
but remember this is not python, it's a sqlite database playground, all the adat is stored in memory, it gets cleared each time you run! @johnnghabs
also maybe try using that sqlite3 lib everyone was talking about @CodeLongAndPros
@Coder100
If the data is cleared every run, you forgot to commit them. On this note, you're not limited to a sqlite3, you can use python and just import sqlite3 lib there
@johnnghabs No, replit has problems storing progomatically-written files. Why else did they create replitdb?
@CodeLongAndPros I'm quite fascinated; what happens with replit if one tries to use a SQL db? AFAIK replitdb was designed for easier usage as it doesn't have the SQL learning curve.
@johnnghabs It'll work, but it's not deterministic— a change committed may or may not show up in the database (or stay there)
Sorry to bring this up; Yes, you can. In every class, you need to call the database to create its DatabaseHelper DB = new DatabaseHelper(this); and then DB. Open (); and after that, DB.yourMethodQuery to call the method you have in your DatabaseHelper.
It's best to have a global DatabaseHelper variable DB and call it at creation to create an instance of DB = new DatabaseHelper(this), and then you can call DB.something anywhere in the class. If that doesn't work, then ask the
https://www.devart.com/dbforge/postgresql/studio/ for help.