Opening connection from both the device's does not gives us issue but creating table does. I tried creating the use case step by step below. On both the nodes I have database with same name as "NotesNew.db", could this lead to issue?
To give more details on the scenario:
1 - I removed the database from both the node's: 1 from my desktop (using Shell from Sqlite3 now) and another from the mobile app (have uninstalled it)
2 - On mobile application (primary connection) I had my connection string as:
file:/data/user/0/com.companyname.App2.Android/files/.local/share/NotesNew.db?node=primary&bind=tcp://0.0.0.0:1234
3 - I ran the mobile application and it ran successfully with no issues
4 - On my desktop I used Shell with database file name as "file:NotesNew.db?node=secondary&connect=tcp://192.168.1.117:1234" where IP of my mobile devise is 192.168.1.117. On shell typing ".tab" was not giving me anything. Please see below
And then using shell commands on my secondary node (desktop) to create table gives us the issue. Pasting the entire shell command for your reference:
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open "file:NotesNew.db?node=secondary&connect=tcp://192.168.1.117:1234"
sqlite> pragma sync_status;
{
"use_litesync": true,
"node_type": "secondary",
"node_id": 0,
"db_is_ready": false,
"sync_down_state": "unknown",
"sync_up_state": "unknown",
"log_storage": "discard",
"peers": [{
"node_type": "unknown",
"node_id": 0,
"conn_type": "outgoing",
"address": "192.168.1.117:1234",
"conn_state": "connected",
"db_state": "unknown",
"log_storage": "unknown"
}]
}
sqlite> .tab
sqlite> .tab;
Error: unknown command or invalid arguments: "tab;". Enter ".help" for help
sqlite> .tab
sqlite> .table
sqlite> create table if not exists "Note" (
...> "ID" varchar primary key not null ,
...> "Text" varchar ,
...> "Date" bigint )
...> ;
Error: access permission denied
sqlite>