View Full Version : SQLite3 Action Plugin (free)
reteset
03-05-2009, 03:08 PM
SQLite3 Action Plugin for AutoPlay Media Studio
This is A Lua module that Orginally written for Lua
This module is ported to an AMS Action plugin
Lua Version : Lua 5.1
SQLite Version : 3.6.5
Plugin Version : 1.0.0.0
Plugin Licence : Just A Thanks
Credits :
Vista Compatibility Tested By Dermot
SQLite3 Lua Wrapper Orginally written By
* Tiago Dionizio
* Doug Currie
You can Download It From Here (http://www.amsplugins.com/details.asp?ID=74&CID=1)
RizlaUK
03-05-2009, 03:35 PM
nice work reteset :yes
Thanks ;)
Imagine Programming
03-05-2009, 05:40 PM
I'll be absolutely happy to say: Thank you!
great work:)
ShadowUK
03-06-2009, 12:27 AM
Lua Version : Lua 5.1
Does this mean, what I think it means?
reteset
03-06-2009, 11:43 AM
Does this mean, what I think it means?
when we are creating plugins ,
we are including a Lua Runtime Library (statically) same as AMS
it was the version of that libray , just for informational
also i wrote SQLite version ,which is 3.6.5 , but latest SQLite version is 3.6.11
i thought, maybe some one may attempt to use a feature of SQLite 3.6.11
ShadowUK
03-12-2009, 01:25 AM
Sounds amazing, You think you might be able to do LuaSocket? It'll really help my project finish.
reteset
03-13-2009, 05:42 AM
Sounds amazing, You think you might be able to do LuaSocket? It'll really help my project finish.
i am busy right now but i'll try it when i have time
kambiz
03-25-2009, 04:27 AM
Nice work,
Thank you! ;)
Shide
03-25-2009, 08:48 AM
It's probably just me, but after installing the plugin and enabling it on my project, when I click on "new action" there is no SQLite3 option in the list like there is for previous versions.... any ideas...?
:huh
Thanks
Andy
reteset
03-25-2009, 10:07 AM
this is not a newer version of official SQLite action plugin
this is a Lua module same as LuaCom
orginally published here http://luaforge.net/projects/luasqlite/
there is no script editor integration with this plugin
you should write functions manually
here is the Function Reference (http://luasqlite.luaforge.net/lsqlite3.html)
also this document is included with some examples into package that you have downloaded
gvanassche
03-28-2009, 06:31 AM
although this is not (yet -- I hope) the new SQLite3 action plugin, this is very promising. Thank you so much reteset & dermot! I'm sure this small community appreciates your work!
I tried to figure out how to use this, but since I'm not a db-specialist at all, I can only use the example to do the same as in the example: create a table and add some records. If I just want to add new records to an existing table, I get stuck. I don't find the cause; I guess it is me ;-)
If anyone could help by creating an extended example, that would surely help!
thanks
gert
gvanassche
03-29-2009, 07:16 AM
what I figured out so far...
I need to add new record in 2 steps:
- a db:exec with CREATE TABLE -- If this has already been done before, the step has no effect.
- a db:exec with INSERT INTO -- This step is always executed
What I did not yet discover is how to add data from input fields...
INSERT INTO Table VALUES (NULL, field1 );
works fine if I enter the data manually like "this is text of field1", but when this data is in a variable, I cannot insert the variable. I can do lot's of other stuff with it (like showing it in a dialogbox)... I don't understand why the variable is not inserted at all...
Has anyone experienced the same problem?
thanks
gert
Have you tried this:
myvalue = Input1.GetText()
sql = "INSERT INTO Table (id, name) VALUES (null, "..myvalue..");"
...assuming your table column names are id and name, respectively.
gvanassche
04-04-2009, 10:51 AM
Hi Bule,
what happens in that case is that the text ..myvalue.. is stored in the db, and not the actual contents of the variable myvalue...
Thanks
gert
ShadowUK
04-04-2009, 10:54 AM
Have you tried this:
myvalue = Input1.GetText()
sql = "INSERT INTO Table (id, name) VALUES (null, "..myvalue..");"
...assuming your table column names are id and name, respectively.
Hi Bule,
what happens in that case is that the text ..myvalue.. is stored in the db, and not the actual contents of the variable myvalue...
Thanks
gert
Both of you have errors.
First, bule.
myvalue = Input1.GetText()
sql = "INSERT INTO Table (id, name) VALUES (null, "..myvalue..");"
Don't you mean Input.GetText("Input1"); ?
And gvanassche, "..Variable.." is concentation, which means "..myvalue.." will be replaced with the variable in myvalue.
Dermot
04-04-2009, 12:52 PM
This
sql = "INSERT INTO Table (id, name) VALUES (null, "..myvalue..");"
Should be
sql = "INSERT INTO Table (id, name) VALUES (null, '"..myvalue.."');"
gvanassche
04-04-2009, 03:26 PM
Bule, Dermot,
I'm not seeing the mistake in my code... Can you help?
local db =sqlite3.open("D:\\Projects\\ProfServ\\test.sqlite")
db:exec[[
CREATE TABLE ProfServ (id INTEGER PRIMARY KEY, cdat, cust, desc, proj, lang);
]]
db:exec[[
INSERT INTO ProfServ (id, cdat, cust, desc, proj, lang) VALUES (NULL, '".. s_cdat .."', '".. s_cust .."', '".. s_desc .."', '".. s_proj .."', '".. s_lang .."');
]]
Thanks!
gert
ShadowUK
04-04-2009, 04:51 PM
Concentation in long strings ( [[ ]] ) is something along the lines of this.
world = "world";
hello = [[Hello ]]..world..[[!]];
Dermot
04-04-2009, 04:57 PM
Try this.
db:exec("CREATE TABLE ProfServ (id INTEGER PRIMARY KEY, cdat, cust, desc, proj, lang)")
db:exec("INSERT INTO ProfServ (id, cdat, cust, desc, proj, lang) VALUES (NULL, '".. s_cdat .."', '".. s_cust .."', '".. s_desc .."', '".. s_proj .."', '".. s_lang .."')");
First, bule.
myvalue = Input1.GetText()
sql = "INSERT INTO Table (id, name) VALUES (null, "..myvalue..");"
Don't you mean Input.GetText("Input1");?
Indeed. Too much of a Delphi lately, I guess.
azmanar
05-15-2009, 02:55 AM
Hi,
Just bumping this thread up for everyone's reference.
Major contributions by our friends, Reteset & Dermot.
reteset
07-10-2009, 01:50 PM
here is a simple first step example for SQLite3 action plugin
actually there are no much differences between standard SQLite plugin
for example sqlite3:exec("") does same thing with SQLite.QuerytoTable
simply : sqlite3:exec("") returns same thing with SQLite.QuerytoTable
this example shows :
Create and open a database
Create a table with simple fields
Add 500 entry
Query and load data into stadard grid object
i am going to update this example when i have got free times
reteset
08-07-2009, 02:11 PM
Correction :
Lua Version : Lua 5.1 was not correct
this plugin uses statically linked Lua 5.0 library that comes with IR PluginSDK
it was an unnecessary information though
sorry for confusion.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.