I am trying to build a web inventory application using a SQLite database hosted in the cloud home directory. I have a database in the home directory and I can query that database while in the code editor but when I publish to a webform the code does not work.
Needs["DatabaseLink`"];
dbFilePath="/wolframcloud/userfiles/********";
conn=OpenSQLConnection[JDBC["SQLite",dbFilePath]]
SQLSelect[conn, "key"]
works file when I am in the notebook. I then go to deploy it to the cloud..
CloudDeploy[FormFunction["Table" -> {"key"-> "key","eltesting"-> "eltesting"},SQLSelect[conn,#Table]&]]
Then when I press submit I get response:
DatabaseLink`SQLSelect[DatabaseLink`SQLConnection[DatabaseLink`JDBC["SQLite", "******"], JLink`Objects`vm1`JavaObject10700769468612609, 6, "Catalog" -> Automatic, "Description" -> None, "Location" -> None, "Name" -> None, "Password" -> None, "Properties" -> {}, "ReadOnly" -> Automatic, "RelativePath" -> False, "TransactionIsolationLevel" -> Automatic, "UseConnectionPool" -> Automatic, "Username" -> None, "Version" -> None], "key"]
I have replaced my file path with ****** for security. If local database storage is not supported what is the best way for my application to store, update and retrieve data? DataDrop is not the correct solution as I need this data to last more than 30 days.
CloudDeploy[Delayed[Needs["DatabaseLink\[RawBackquote]"]; SQLTables[OpenSQLConnection[JDBC["SQLite", FileNameJoin[{$CloudRootDirectory, "EmptySQLiteDatabase"}]]]]], FileNameJoin[{$CloudRootDirectory, "EmptySQLiteQuery"}]]
does not give the expected empty list, but just displays unexecuted code like that you've posted above. I've emailed Wolfram Support asking if this code will execute at the Produce price point. $\endgroup$