SQLite database in Javascript locally

前端 未结 4 669
梦谈多话
梦谈多话 2020-12-24 09:26

I\'m using a PhoneGap project on XCode. I am trying to connect to a SQLite databse by using Javascript.

I have made a file \"myDatabase.sqlite\" in an SQLite tool.

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 09:55

    I had same problem and I found out that you cannot use your sqlite db like this.

    I used chrome and I found out that Chrome stores DBs in "C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\databases".

    There is a Databases.db that Chrome uses for managing DBs.

    If you want to use your db you should add a record into Databases.db and put your file in "file__0" directory and rename it (your db file) to the id that is assigned to that record.

提交回复
热议问题