0

I have some local.db file and just want to run some sql query on it. Do I need to run a localhost server and then somehow connect to it in order to run proceed? (This is for a simple client-side project with html,js,css)

jimbob542
  • 121
  • 1
  • 1
  • 7
  • SQL is a specialized programming language operating on data stored in particular ways. You can use some simple tools to perform some of the operations available through a DBMS on plain files, but it's a stretch to call that "SQL". – Pointy Feb 18 '19 at 02:21
  • It is hard to answer the question without knowing what type of database file it is (i.e., MySQL, MS-SQL, Oracle, etc.). – Frelling Feb 18 '19 at 02:35
  • @Frelling Its just a sqlite .db file – jimbob542 Feb 18 '19 at 02:40
  • @jimbob542 One more question. what are you using to run JavaScript, is it Node.js or are you just running some basic JavaScript within an HTML in the browser? – Frelling Feb 18 '19 at 02:50
  • @Frelling Just basic JS functions contained in – jimbob542 Feb 18 '19 at 02:51

1 Answers1

0

@jimbob542 Thanks for suffering the game of 20 questions. Given that you are looking to access SQLite data from within an HTML using JavaScript, please refer to this SO answer Is it possible to access an SQLite database from JavaScript? There are some limitations, but hopefully it will do what you need.

Frelling
  • 3,287
  • 24
  • 27