# Cloud Form Function Database

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]&]]


It looks great

Then when I press submit I get response:

DatabaseLinkSQLSelect[DatabaseLinkSQLConnection[DatabaseLinkJDBC["SQLite", "******"], JLinkObjectsvm1JavaObject10700769468612609, 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.

• Do you have a free Wolfram Development Platform account? Perhaps SQL commands like SQLSelect are disabled for such an account. The pricing page mentions database connectivity at the 100/month Producer price point. Wolfram support might be able to tell you if SQLSelect starts working at the 20/month Explorer price point. If you included the SQLite setup code in your question, it would be easier for others to test this. Mar 23, 2016 at 14:49
• @ChristopherHaydock here is some code to create a database so you can test. It will be empty but then calls should just return {}. Needs["DatabaseLink"]; conn = OpenSQLConnection[ JDBC["SQLite", ToFileName[Directory[], "example"]]] Mar 23, 2016 at 15:24
• At the Explorer price point of the Wolfram Development Platform 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. Mar 23, 2016 at 20:05

CloudEvaluate[
Needs["DatabaseLink"];
`