Page 1 of 1

Please add SQLite storage support.

Posted: 19 Jun 2015 10:44
by psydex
Internal variables is good, but in some cases i need to store very much records, so storing data in SQLite base would be perfect decision for that purposes.

Re: Please add SQLite storage support.

Posted: 01 Jul 2015 13:56
by dah
Yes, this would be really useful and I missed this feature a few times in the past.

It's possible to use SQLite using the command line action but this was more difficult than it could be with a dedicated Automagic action (if I remember correctly, escaping strings was a pain).

SQLite has a ton of useful features that Automagic users could benefit from.

Re: Please add SQLite storage support.

Posted: 19 Aug 2015 11:45
by psydex
or maybe add ContentProvider://automagic/TargetName/Request*
and triggers for Targetname ?

Re: Please add SQLite storage support.

Posted: 14 Dec 2019 19:42
by jassing
I was just looking for sqlite solutions...
I tried&failed at using a Tasker plugin...
Would be really nice if Automagic supported sqlite natively, the libraries must already exist with Android...

Re: Please add SQLite storage support.

Posted: 15 Dec 2019 10:19
by Desmanto
There is SQLite binary, that you can take from other app such as Titanium Backup. But you still need root to do that. Maybe putting it to busybox no root can make it executable without root. But I never try it.

I don't know your main purpose with the SQLite. But if you need to store something as database, I have posted several solutions : viewtopic.php?f=6&t=7802&p=24342&hilit=database#p23213
Nowadays, I back more to the csv side, although I still use nested map/list. It is because I realized the json is just a pivoted csv. So I still can convert csv to json vice versa, as long I understand the structure. This makes my flow speech database way way much simpler, because I can easily edited it excel or edit it in Automagic without any lost in formatting.

Re: Please add SQLite storage support.

Posted: 15 Dec 2019 13:43
by jassing
On my phone, of the files I can see (non rooted) there are 8 separate apps that use sqlite as their data storage. I find it hard to believe that they are developing their own implementation for various platforms. Seems more likely that a common file works a cross the board.
Text file solutions are not ideal for random access & searching data.

sqlite android doc
android developer documentation
And lastly... the answer to the question: is sqlite built into android?

It seems as easy as implementing it into a windows application... I find there's three types of wrappers that will handle most cases...
Open/close a database file
Execute a command (like create table, insert, update, etc)
& queries. For AM, this could be returned as a json string...

As a request, I think it's reasonable to want a database feature... But it's no over-the-weekend implementation.

Re: Please add SQLite storage support.

Posted: 15 Dec 2019 16:03
by Desmanto
Oh. That's right. I can find java function to do all SQL stuff, but I don't know how to utilize that yet. This seems to be a reasonable request. Maybe create an action element for the SQL stuff, where you can create, query, delete and do many things. Or maybe if it is possible, create the script function with the sqlquery() and different other function.

SQLite can store blob/binary data, which may be totally different variable type. But that is actually can be similar to image_data that Automagic already have. So I will just wait for the best suited implementation.

Re: Please add SQLite storage support.

Posted: 16 Dec 2019 01:56
by anuraag
@desmanto can you link to functions you find.?
Some months back when i tried i failed using java script. I want to try again.

Edit: https://stackoverflow.com/a/3914899 working. Similar what tasker's SQL QUERY do. But i don't know how to implement DatabaseHelper so that i can close database.

Re: Please add SQLite storage support.

Posted: 16 Dec 2019 17:57
by Desmanto
@anuraag : I just use function calljava, either the method or static method, then find "sql". I founds tons of them but don't know how to put them in use.

Ever tried to grasp the idea of the SQL, and actually I need it too in some program. But it seems csv and json is easier to be implemented in Automagic, so never try it. But if Automagic support it, I might started to using it too for some big database that require indexing.

Re: Please add SQLite storage support.

Posted: 17 Dec 2019 00:37
by anuraag
I think it's not possible to implement it using java functions available. We need @Martin to add it.