Choice of Database schema for storing folder system

Your first schema will work just fine. When you put an index on the FullPath column, use either the case-sensitive BETWEEN operator for queries, or use LIKE with either COLLATE NOCASE on the index or with PRAGMA case_sensitive_like. Please note that this schema also stores all parents, but the IDs (the names) are all concatenated … Read more

What’s the best way to read Sqlite3 directly in Browser using Javascript?

There is a javascript library called sql.js that can do exactly what you want. In your case, you would use it like that const SQL = await initSqlJs(options); const fetched = await fetch(“/path/to/database.sqlite”); const buf = await fetched.arrayBuffer(); const db = new SQL.Database(new Uint8Array(buf)); const contents = db.exec(“SELECT * FROM my_table”); // contents is now … Read more

SQLite list ALL foreign keys in a database

It seems that all (or many) of the PRAGMA commands can be programatically selected with a little trick; Usually the are called like: PRAGMA table_info(‘my_table’); PRAGMA foreign_key_list(‘my_table’); But this can also be done: SELECT * FROM pragma_table_info(‘my_table’); SELECT * FROM pragma_foreign_key_list(‘my_table’); And the schema can also be (more or less) obtained: .schema pragma_table_info /* pragma_table_info(cid,name,type,”notnull”,dflt_value,pk) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)