REBOL3 - SQLite (C library embeddable DB [web-public])

Return to Index Page
Most recent messages (300 max) are listed first.

#UserMessageDate
709AshleyAre you able to connect to an existing db file?8-Apr 0:49
708Willconnect/log/create d ** User Error: SQLite out of memory ** Near: make error! reform ["SQLite" error]7-Apr 20:00
707WillThank you Ashley, have changed to v2 but get:7-Apr 20:00
706AshleyWill, did you try modifying the following lines in the driver:

*lib: load/library ... ; to call the correct version *prepare: make routine! ... ; to use "sqlite3_prepare_v2" instead of "sqlite3_prepare"

7-Apr 10:47
705RobertSo, getting a database system that has much better / native Rebol support makes a lot of sense. Hopefully such a system will once be implemented on the C level for good performance etc.31-Mar 15:00
704RobertBut, it stays a SQL database not directly optimized for Rebol usage.31-Mar 14:59
703RobertOk, and please don't get me wrong. SQLite is nice because it's small and simple to attach to Rebol, thanks to the work of Ashley. So even for 10K records you can use it because the costs are low.31-Mar 14:59
702btiffinI didn't expect to win the fight, but I wasn't really expecting to get pinned on the first move. :) But I'll struggle a little more. In the long run I think the simplicity of the pure REBOL solutions (and a little careful manual (or scripted) management) will have fewer headaches than a larger full scale ACID database (again in the small dataset arena).

My opinion may vary over time and over projects...but not today. And sorry about clogging the SQLite chat. rebols could well build up a fair amount of expertise with this engine given that load/library is now open to all.

31-Mar 14:33
701Robert;-) Are RebDB and TRETBASE ACID conform?31-Mar 8:34
700btiffinRobert; I'll fight you on that. :) Depends on the scale. RebDB is beautiful for dbs under the 10K ish limit; TRETBASE is destined to be a very handy REBOL scripting database engine, and Paul has been hammering on some larger datasets, (not something I'd plan on, but it's being developed that way). So unless you are working in the 100K+ record arena, or need multiple user concurrency, I do think REBOL is the right tool for a database engine.30-Mar 15:15
699RobertTretbase? I think it's pur Rebol based, right? No I won't. I don't think Rebol is the right tool for a database engine.30-Mar 8:19
698RobertI got the DLL into 215KB :-)30-Mar 8:18
697RobertI have 3.5.7 running on Windows together with Rebol. Works perfectly.30-Mar 8:18
696Willmaybe someone could check if 3.5.7 works with other platforms, if not, the sqlite.r maintainer can maybe spot an easy fix looking at http://www.sqlite.org/changes.html30-Mar 0:27
695Willbtw, are you all considering moving to treatbase?30-Mar 0:20
694WillThanks BrianH, i'll stick with 3.4.030-Mar 0:19
693Willmacport/sqlite3 version 3.5.4 worked but was 2 times slower than with 3.4.030-Mar 0:19
692BrianHI expect that is due to changes in SQLite - it has changed the API a bit between 3.4.0 and 3.5.x30-Mar 0:02
691WillI'm on os x 10.5.2, sqlite.r works fine with system preinstalled sqlite which is version 3.4.0, but doesn't work with latest version 3.5.7 (installed thru macports), is this known or os x specific?29-Mar 23:45
690WillI wanted separate connections, but maybe I understand it wrong as it is not same as with mysql, so probably have to go with attach, thanks for the suggestions.29-Mar 23:44
689RobertWhy not use ATTACH?26-Mar 20:24
688WillWhat I need is connect to a database , than in a second time, connect to another database, multiple connections open, no sqlite attach, possible?25-Mar 15:38
687PavelOr recompile the DLL with MAXDATABASES optinon increased25-Mar 6:57
686Pekrwith the driver, just use connect [db1 db2 db3] etc. IIRC, you can attach max 9 databases ...25-Mar 5:48
685Pekrvia the 'attach command?25-Mar 5:48
684Willhow can I connect to multiple databases at the same time without disconnecting?25-Mar 3:47
683GiuseppeCI have found an interesting PHP project I would like to see ported on Rebol: http://adodb.sourceforge.net/ . It is a layer to access nearly all database available in this world with plugings.27-Dec 19:13
682GrahamIt does raise interesting possibilities though for other things.20-Dec 20:41
681GrahamI'm storing user configuration data on the server (firebird) in a text blob field ... which is one serialized rebol object. Each time I change a configuation parameter, the whole object is saved back to the database.20-Dec 20:38
680GrahamMaybe Altme could use it to store local messages?20-Dec 20:37
679BrianHGraham, that features page also says how to use SQLite to manage the files that store your application data. It's a cool hack.20-Dec 16:28
678BrianHBTW, your new release doesn't seem to be downloading :(20-Dec 16:26
677BrianHIt is usually suggested that you build your own wrapper. REBOL/Services would be good for this.20-Dec 16:25
676PekrIs there any commonly suggested server mode? I mean tcp server, serialising requests, querying db and returning results back to users?20-Dec 6:32
675AshleyFrom "Suggested Uses For SQLite" ( http://www.sqlite.org/features.html )

Website Database Because it requires no configuration and stores information in order disk files, SQLite is a popular choice as the database to back small to medium-sized websites

Stand-in For An Enterprise RDBMS SQLite is often used as a surrogate for an enterprise RDBMS for demonstration purposes or for testing. SQLite is fast and requires no setup, which takes a lot of the hassle out of testing and which makes demos perky and easy to launch.

20-Dec 5:19
674AshleyWhy not? It's ACID compliant and SQLite on a server where all file ops are local to the DB process seems OK to me.20-Dec 4:57
673Grahamprobably not from what you say.19-Dec 23:14
672Grahammessage board??19-Dec 23:14
671Pekrsingle user apps. Or fileshared ones. Embedded space. Advantage against mySQL embedded - SQL interface, free. Not easily used for server solutions, although could be solved by some server dispatching requests. No installation, just one single dll.19-Dec 22:53
670Grahamdomain of use19-Dec 22:45
669Pekrdo you mean domain of usage? or?19-Dec 22:41
668PekrI can confirm it fixes data corruption for my case. Nice fix!19-Dec 22:41
667Pekrwhat do you mean by "domain"?19-Dec 22:40
666Grahamwhat's sqlite's domain?19-Dec 22:37
665PekrNew version released ... hehe, my ticket is part of the announcement :-) http://www.sqlite.org/news.html19-Dec 22:32
664RobertI will make an update of the SQLite engine. I'm still using a rather old one.17-Dec 10:49
663RobertPetr, congrats to really find a bug. I think I have been hit by this one too.17-Dec 10:49
662GiuseppeC(Hoping in a free upgrade to R3)14-Dec 10:40
661GiuseppeCI know. I will buy the /pro version next year and the whole package when my application will be ready.14-Dec 10:40
660BrianHYou don't need /Command SQLite, just library access and you get that in /Pro. There are other advantages to /Command though.14-Dec 10:32
659GiuseppeCNow I expect a totally free Rebol/Command :-)14-Dec 10:30
658PavelTo GiuseppeC there is a simple server based on SQLite look at SQLIte Wiki/SQLiteNetworks/uSQLiteServer a protocol to this is also in rebol.org.

Anyway I can tell you a secret not to tell anybody: try to use rebface.exe from public available REBOL/SDK 2.7.5 BETA . It seems the /Pro restriction is not applied there for some reason and SQLite protocol works sweet for me there. You can got an idea run "local database backend" in one rebface process and application in another on rebol version of your choice.

THANKS ASHLEY FOR A GOOD JOB.

14-Dec 10:14
657GiuseppeCNO, I want to use R2. I will be using R3 only for small projects and to help the comminity into debugging ! Have you already read what I think about people complaining R3. Your is a provocation !!! :-)))))13-Dec 20:15
656GiuseppeCThen I'll give me Rebol/Pro or the whole command/sdk as present.13-Dec 20:14
655PekrNext year you will be using R3 :-)13-Dec 20:14
654GiuseppeCThanks pekr, I'll take a look at it. Next year, when I'll have more knoledge in RebGUI and Rebol2 I need to start a project which needs a database but it will be a single user project so SQL lite.is good enough.13-Dec 20:13
653PekrI hope that it gets fixed.13-Dec 20:11
652PekrWell - there is btn-sqlite (better than nothing) driver on rebol.org It works, with one bad effect - black console window appearing during the shell call. Just recently I put it on high priority list for W.7.6 to be fixed - all is needed is to set one flag for shell call ....13-Dec 20:11
651GiuseppeCI ahve read in the doc that Rebol/Pro is necessary. Could you explain ?13-Dec 20:11
650Pekrnot necessarily.13-Dec 20:10
649GiuseppeCPekr, joining tables and having the data on disk are already two good points for SQL Lite. Obviusly I need Rebol/Pro licence before using it.13-Dec 20:06
648PekrThat is still not full-fledget SQL server - those provide you with network independent access ...13-Dec 20:05
647GiuseppeCSorry Henrik my intentions where not to SPAM, I have later found the SQL lite group than the RebDB. Promise I'll write only once starting from now. Don't be upset :-)13-Dec 20:05
646PekrRebDB is also mostly - in memory only database. It does not live on hd. So - SQLite has one advantage here - it supports locking over file-shared SQLite database.13-Dec 20:05
645PekrSQLite has one main advantage - it supports SQL like syntax - you can join tables. I can't imagine living without those features anymore.13-Dec 20:03
644Henrik"I ask here too" No need to cross post. We can all see the messages.13-Dec 19:54
643GiuseppeCI ask here too, I want to adopt a database system for my rebol projects: which are the advantages of SQLLite over RebDB ? Why should adopt the first or the latter ?13-Dec 19:53
642PekrIt seems I found a bug :-) http://www.sqlite.org/cvstrac/tktview?tn=283212-Dec 12:51
641PeterWoodI didn't think that you needed to write any code to backup individual tables in SQLite but just supply the table name as a parameter to the .dump command.

I believe you can do this from the command line with SQLite3.

2-Dec 9:59
640Pekrwell, SQLite is really cool, but simply noone can defend that one argument to me. I also communicated that "defficiency" on their ml, and simply put - it is the way it is. 'Attach function is just nasty workaround, nothing more. But - I talk about some 5% of feature, which would I found usefull, I will use sqlite anyway, as simply put there is no simple replacement to what it provides ...2-Dec 9:07
639Pekryou can, by creating some code to do so, not by simply looking into the directory and using default OS facilities.2-Dec 9:05
638PeterWood..want ????1-Dec 8:46
637PeterWood..then why don't you just back up the tables that you ?1-Dec 8:46
636Pekrif that size is not necessarily 100MB and you don't need to back-up all the files all the time ....1-Dec 7:23
635Grahamme too30-Nov 20:25
634IngoWell, simplicity lies in the eyes of the beholder ... just having to back up a single file seems pretty easy to me ...30-Nov 19:23
633PekrRobert - tried that. Sadly it does not fix the issue. I will try to get to their ml and post the finding. Maybe I am doing something incorrectly, otoh I think that corruption should never happen, even if query would be nonsense :-)30-Nov 4:06
632Pekr... and they definitely should completly remove their claim that 1 file for db is an advantage. That is the most serious obstacle of sqlite ... simplicity comes via ability to easily backup ... one file per index, table ...30-Nov 3:53
631Pekrgee, what are they doing? 50KB more size of dll to fix few bugs? They should aredy fix their docs whee they claim that other engine libraries start at 450KB ... they are nearly there too ...30-Nov 3:52
630RobertMaybe that's the problem?29-Nov 17:30
629RobertPetr, the new SQLite 3.5.3 release states:

Fix a long-standing bug in INSERT INTO ... SELECT ... statements where the SELECT is compound.

29-Nov 17:30
628PekrI found the culprit but I doubt it is enough to track possible bug. Issuing following statement will make subsequent update corrupting data:

sql trim/lines "insert into prevodnik select kod, nazev, puvodni_kod, puvodni_kod, typ from produkty where substr(kod,1,1)='9' and kod like '%BZ'"

update or replace produkty set kod = (select novy_kod from prevodnik where prevodnik.kod=produkty.kod) where exists (select kod from prevodnik where prevodnik.kod=produkty.kod)

27-Nov 17:40
627Pekrprodukty.kod is unique ... if I remove "or replace" part, data seem to be OK, but it just no more does what I need it to do ....27-Nov 14:21
626Pekruh, it is update or replace which messes my data with nonsense :-(

update or replace produkty set kod = (select novy_kod from prevodnik where prevodnik.kod=produkty.kod) where exists (select kod from prevodnik where prevodnik.kod=produkty.kod)

It is supposed to simply to lookup the "prevodnik" (translator) table, if there is new code (novy_kod). both tables seem to be OK, but after that statement kod in produkty (products) gets messed up ....

27-Nov 14:20
625Pekrah, today I got another data corruption with sqlite driver ....27-Nov 13:40
624PekrWTF! I got burried by very strange behavior, which I would like to know what happened. IMO it is not related to SQLite itself, but maybe it is a deeper REBOL bug? Simply put I have following statement:

sql "update or ignore produkty set kod = (select novy_kod from prevodnik_devitky where prevodnik_devitky.kod=produkty.kod) where exists (select kod from prevodnik_devitky where prevodnik_devitky.kod=produkty.kod)"

... and I was becoming crazy, that the update did not happen. No indexes used (well, I am starting practically with sql, so no need to mess things more :-), and when I put EXACTLY the same line into SQLiteAdmin tool, it was performed OK.

I was really becoming mad, because it seemed to randomly work, when I changed/simplified the expression. Then I remembered my 2 years old ODBC scripts, when we imported data into SAP, from Database Advantage Server. I remembered there was some problem with multiline statement unless I used trim/lines.

I thought to myself, well, it was ODBC driver related, but why not to try it? So I tried to reformat my query to:

sql trim/lines "update or ignore produkty set kod = (select novy_kod from prevodnik_devitky where prevodnik_devitky.kod=produkty.kod) where exists (select kod from prevodnik_devitky where prevodnik_devitky.kod=produkty.kod)"

... and it started to work from my script. And I ask once again - What is going on here? 2 hours lost, which drove me nearly insane :-) I use no special editor but Notepad. The statement returned no error, so I thought it got performed, just incorrectly. It all seems to be related to one aspect - line is too long, so it wraps in Notepad and unless I use trim/lines, it is not performed.

Any educated gues to what is happening here? It is not SQLite related imo, I just did not know where to put it, as general bugs group is not here ....

27-Nov 10:05
623Ashley"even if column type is text" ... see http://www.sqlite.org/datatype3.html#affinity25-Nov 22:54
622BrianHOK, I think that is what Petr concluded :)25-Nov 22:52
621Ashley"Perhaps the REBOL driver hasn't caught up." ... SQLite datatypes have not changed for a long time, the driver supports them all in direct mode.

"I don't understand what is our /direct mode good for" ... http://www.dobeash.com/SQLite/user-guide.html#section-2.1.3

25-Nov 22:51
620MaartenYep. Rebol is superb for data manipulation23-Nov 18:26
619PekrI really sometimes think of simply submitting two queries into sql, having results in block, doing it in rebol level, and then to build tables from the scratch by inserting into new tables :-)23-Nov 17:39
618Pekrour subsidiary company changed IDs of some products during the inventory in our system ;-) I need to create table called e.g. transform-id(oldid, newid) .... and now I would like to somehow do:

foreach row maintable [if found? in transform table maintable/id, then replace maintable/id with newid) :-)

23-Nov 17:38
617Pekrhow to do effectively following using SQL?23-Nov 17:34
616Pekrguys, have you ever got to situation, that working with rebol itself was more productive than with SQL? I redone my version of inventory checking to SQL, and thas thing imports for 10x more time, and most of the checks I do on rebol side anyway. Kudoz to remove-each function too :-)23-Nov 14:48
615Pekrnot without direct ....23-Nov 14:44
614RobertNever had a problem with this.23-Nov 11:47
613RobertThe SQLite driver transforms all necessary " and ' stuff.23-Nov 11:47
612Robertsql ["select * from test where id = ?" 5]23-Nov 11:47
611PekrIt seems to me I will work with /direct refinement. That way REBOL string "aaaaa" is stored in sqlite as 'aaaa', so direct queries for 'aaaa' in console work, and back-loading (select) to rebol returns it as a rebol string. Without direct, 'aaaaa' would be returned as word ...23-Nov 8:52
610BrianHHere is the SQLite docs about datatypes: http://www.sqlite.org/datatype3.html23-Nov 7:35
609BrianHAs for the datatype mismatch, I would have to look at the code of sqlite.r to see if it is aware that SQLite data is no longer typeless.23-Nov 7:11
608BrianHMySQL has a non-standard command for inserting if not there for update: REPLACE. SQLite has more detailed conflict resolution, but includes REPLACE as a MySQL-compatible shortcut for INSERT OR REPLACE (the OR REPLACE is itself a shortcut for ON CONFLICT REPLACE). I agree that UPDATE should have the option of acting like INSERT OR REPLACE.23-Nov 7:09
607PekrI simply want rebol string "1234" to be stored as '1234' and when returned from query to be it once again "1234" not integer if I use '1234' (when using compose and sending string query)23-Nov 7:06
606PekrI don't understand what is our /direct mode good for, it does things as {"1234"} .... without it, rebol stores "1234" .... now if you want use tools like sqliteadmin, you would be mad using /direct mode stored values ...23-Nov 7:05
605BrianHSQLite used to only have text values - numbers were translated at runtime. Perhaps the REBOL driver hasn't caught up.23-Nov 7:03
604Pekrnow I have to choose, if I work with rebol only, or console only.23-Nov 7:02
603Pekrhmm, but issuing single '5', it is returned to rebol as integer, even if column type is text, that sucks :-)23-Nov 7:01
602Pekrit might work with rebol, but when you go to consolo and issue select * from test where id='5', it is not found. Because rebol stores it as "5", so I have to issue '"5"'23-Nov 6:59
601Pekrimo our driver does not work correctly. I am totally confused by modes. Neither /direct nor normal mode does what I expect. I want rebol string to be stored as string in sqlite.23-Nov 6:58
600BrianHIt just doesn't check for cascading actions or trigger events until it is done.23-Nov 6:57
599BrianHNo, I'm saying that update deletes the original record and inserts a new one, on every relational database I know. No update-in-place.23-Nov 6:56
598Pekrit does not sound appropriate, or why guys were asking mysql to add insert .... on duplicate key update facility, if update would be able to do it itself?23-Nov 6:55
597Pekrso you trying to say, that update, if record does not exist, will add new one?23-Nov 6:54
596Pekrsimply put, I don't want to issue a reqeust first, then decide if received recordset is zero lenght to insert, and if ther is some record, to update ....23-Nov 6:54
595BrianHI don't think it changes the row id though, and definitely doesn't change the primary key.23-Nov 6:52
594BrianHAll updates work like that, in every database that I am familiar with. It's a transaction isolation thing.23-Nov 6:51
593BrianHWhat are you talking about?23-Nov 6:50
592Pekrit has insert or replace = replace, but that deletes original record and replaces it with new, probably changing row id, so no facility like insert .... on duplicate key update .....23-Nov 6:50
591Pekrhmm, sqlite does not provide insert or update facility, that is weak :-(23-Nov 6:49
590PekrOur Sqlite docs say: "2.3.3 Fkeys - This refinement returns information about the foreign keys (if any) that reference a table.", but sqlite does not support foreign-keys, only via triggers, no?22-Nov 14:26
589Ashley1.0.4 available at: http://www.dobeash.com/download.html

Mac OS X version 10.4 support added as per http://developer.apple.com/documentation/MacOSX/Conceptual/OSX_Technology_Overview/AppTechnology/chapter_5_section_20.html

20-Jul-07 9:00
588Pekris there any solution, how to infuence shell window appearance, if using sqlite3.exe? There seems to be no silent mode ... you can start sqlite3.exe and type .help to see more comands, or look here:

http://www.die.net/doc/linux/man/man1/sqlite3.1.html

2-Jul-07 8:29
587Ashleyhttp://www.sqlite.org/

2007-Jun-18 - Version 3.4.0

This release fixes two separate bugs either of which can lead to database corruption. Upgrading is strongly recommended.

22-Jun-07 1:09
586RobertGreat! I'll give it a try with a new DLL.22-Feb-07 18:33
585Ashley1.0.3 available at: http://www.dobeash.com/download.html

Supports latest SQLite v2 API.

*** WARNING *** Is not compatible with older versions of the SQLite DLL.

20-Feb-07 5:30
584RobertAshley, it looks mostly compatible to me, just the returned errors are a bit different.18-Feb-07 12:17
583RobertWill, thx for the link.18-Feb-07 12:17
582Willone more link related to trees in mysql: http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html17-Feb-07 23:01
581Ashley"are you working on an update to SQLite.r at the moment?" I didn't even know they had changed the API! If it's an easy change I'll do it sooner than later.17-Feb-07 22:22
580RobertNo, just the plain version.17-Feb-07 15:04
579Pekrbtw - do you use collation for the german language?17-Feb-07 13:53
578RobertI don't know.17-Feb-07 13:52
577PekrHow long will the old API exist?17-Feb-07 13:51
576RobertAshley, are you working on an update to SQLite.r at the moment?17-Feb-07 13:43
575RobertI'm thinking about updating to the newest SQLite version. And I just read there is a new API which should be used.

The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are recommended for all new programs. The two older interfaces are retained for backwards compatibility, but their use is discouraged. In the "v2" interfaces, the prepared statement that is returned (the sqlite3_stmt object) contains a copy of the original SQL. This causes the sqlite3_step() interface to behave a differently in two ways:

If the database schema changes, instead of returning SQLITE_SCHEMA as it always used to do, sqlite3_step() will automatically recompile the SQL statement and try to run it again. If the schema has changed in a way that makes the statement no longer valid, sqlite3_step() will still return SQLITE_SCHEMA. But unlike the legacy behavior, SQLITE_SCHEMA is now a fatal error. Calling sqlite3_prepare_v2() again will not make the error go away. Note: use sqlite3_errmsg() to find the text of the parsing error that results in an SQLITE_SCHEMA return.

When an error occurs, sqlite3_step() will return one of the detailed result-codes like SQLITE_IOERR or SQLITE_FULL or SQLITE_SCHEMA directly. The legacy behavior was that sqlite3_step() would only return a generic SQLITE_ERROR code and you would have to make a second call to sqlite3_reset() in order to find the underlying cause of the problem. With the "v2" prepare interfaces, the underlying reason for the error is returned directly.

17-Feb-07 13:43
574SunandaIt's worth tracking down some of Joe Celko's articles on the issue too. http://www.ibase.ru/devinfo/DBMSTrees/sqltrees.html8-Jan-07 18:54
573Pekras for real graphs with relational model storage - that is beyond my understanding .... hopefull article might give you some pointers ...8-Jan-07 18:46
572Pekrheh, never heard of answers.google.com ... well, maybe that is why I would like to work as a consultant, hopefully with IBM ... the bad thing is, that I might miss programming a bit :-)8-Jan-07 18:46
571Robertand of course having more than one parent.8-Jan-07 18:43
570RobertThx for the link. As always, good references Petr. You should make your money with answers.google.com8-Jan-07 18:43
569Robertyes, most likely but with the possibility to have cycles etc.8-Jan-07 18:42
568PekrI have good link, although it relates to mySQL - it shows how to query hierarchical data - http://dev.mysql.com/tech-resources/articles/hierarchical-data.html8-Jan-07 18:32
567PekrRobert - what do you mean as a graph? A hieararchical structure?8-Jan-07 18:30
566RobertQuestion: I have something like a bill-of-material. And I would like to get such a structure back as graph. I'm just thinking of this isn't a generic function suitable to be coupled with a database. What do you think?8-Jan-07 17:40
565Pekrthat has a bit of a bad effect for sqladmin grid ... if you don't specify field type or length, it lists one collumn wide thru all the screen ...22-Dec-06 9:50
564RobertI never specify anything. Only for INTEGER22-Dec-06 9:44
563Pekrwhat do you use for typical rebol strings, or even dates? text? varchar?22-Dec-06 9:28
562RobertThere is just no need for this. The DB should store each cell most efficient.22-Dec-06 9:28
561RobertThat's cool!! One of SQLite big advantages. Why should I be forced to tell the type upfront?22-Dec-06 9:28
560PekrI read "manifest typing" and it is strange - even if you set your column as an integer, it allows you to enter non-integer data ...22-Dec-06 9:27
559RobertPetr, yes I have seen some effects of these as well. But didn't tracked them further down yet.22-Dec-06 9:26
558AshleyBe sure to read "Manifest typing" at http://www.sqlite.org/different.html21-Dec-06 21:42
557PekrThere seems to be a bit messy situation in how integers are handled with SQLite, so beware. If you don't specify column types, as eg. in my following example:

create table logs (date, time, ipaddr, url, ctype, incident)

, then expect following situation:

1) sql "select incident from logs where incident = 4" ; works 2) sql ["select incident from logs where incident = ?" 4] ; works 3) sql "select incident from logs where incident = '4'" ; does not work

The strange thing is, that editing my db in SQLiteAdmin, it shows not column types (but imo it has to choose some "default" type internally). Changing according field type to Integer type, makes above case number 3) to work too ...

So maybe it is always better to not be lazy and specify precisely column types? But in fact, when I specified column type as Integer, I did NOT expect case 3 to work ... I am going to do more tests myself to save myself from later headaches during specifying more complicated queries :-)

21-Dec-06 15:23
556Volkermaybe that methods helps in your case too.15-Dec-06 12:20
555Volkerthat saved my script, which uses beer and heavy blitting15-Dec-06 12:20
554Volkerbeer-client-loop: func [/local last-mem mem-jetzt ports-bak] [ recycle/off last-mem: stats forever [ if error? set/any 'error try [ wait 0.1 ] [ write %autsch.txt mold disarm error win-log print "-----------------" print disarm error ] if 20 * 1000 * 1000 + last-mem < mem-jetzt: stats [ recycle last-mem: stats /print [now/time mem-jetzt - last-mem mem-jetzt last-mem] ] ] ]15-Dec-06 12:19
553AshleyPekr, the import statement for your script would look like:

sqlite/import "insert into logs values (?,?,?,?,?,?)" log-info

and is about twice as fast as the foreach loop (and now works correctly under 1.0.2).

15-Dec-06 11:27
552Ashley1.0.2 available at: http://www.dobeash.com/download.html

Workaround to RAMBO#4063. Seems to work with Pekr's and my test cases after several thousand runs without error.

15-Dec-06 11:23
551AshleySuccess! ... of sorts. If you add a 'recycle as the first line of the 'sql func then all seems to work fine; but a lot slowwwwwwer (1 minute 48 as opposed to 1.5 seconds in Pekr's test case).

But, if you recycle every 100 statements it still works and only increases the runtime to 1.85 seconds. I'll do a few more tests before uploading a new version with this change.

15-Dec-06 10:54
550AshleyPekr, "... Ashley posted his findings about it ...", refer post of 7th Nov in this group.

Note that it works fine if you use the direct refinement, but then you won't have access to the full range of REBOL data types. Also note that you can use IMPORT instead of a foreach loop, as in:

IMPORT statement values

15-Dec-06 10:31
549RobertI use the SQLite command line tool for batch importing.15-Dec-06 9:40
548RobertPetr, I had the same problem. There is a RAMBO ticket and Ashley posted his findings about it.15-Dec-06 9:40
547Pekrok, so how can I explain to mysel data corruption? It is reproducable. should I set type of fields when creating tables? Or should I create tables in external tool?15-Dec-06 8:40
546AshleyCONNECT %test.db

SQL "drop table t" SQL "create table t (c)"

SQL "insert into t values ('Word')" SQL {insert into t values ('"String"')} SQL ["insert into t values (?)" 'Word] SQL ["insert into t values (?)" "String"]

test1: SQL "select * from t"

DISCONNECT

CONNECT/direct %test.db

SQL "drop table t" SQL "create table t (c)"

SQL "insert into t values ('String')" SQL ["insert into t values (?)" "String"]

test2: SQL "select * from t"

DISCONNECT

14-Dec-06 23:07
545BrianHDoes block mode do datatype conversions? Perhaps there is a type mismatch.14-Dec-06 18:27
544PekrMaybe there is a bug with block mode?14-Dec-06 18:17
543PekrI am confused about what driver is doing ... the difference of Direct mode. Hmm, maybe I do - there is a difference between the string mode, and block mode. With string mode, the driver does not touch the expression, so I am responsible for putting VALUES('06-Dec-2006') or VALUES('"06-Dec-2006"') - simply put - if I want in db to have my date value being represented as a REBOL string, I have to put it into parenthesis myself. So actually parenthesing it twice, as sqlite itself already uses '06-Dec-2006' and considers it being a string ...14-Dec-06 18:05
542Pekrwhereas this one does not:

SQL reduce ["INSERT INTO logs VALUES (?, ?, ?, ?, ?, ?)" date time ip-address url content-type incident-id]

14-Dec-06 17:57
541Pekruf, following works. Maybe it has something with my nonunderstanding of differences between string/non string values and how to properly insert them ...

SQL s: rejoin ["INSERT INTO logs VALUES ('" date "', '" time "', '" ip-address "', '" url "', '" content-type "', '" incident-id "')"]

14-Dec-06 17:56
540Pekrlater in the night, or over the weekend I will try not to use block syntax, but rather compose query string. All values inserted are strings (I tried with native rebol datatypes too)14-Dec-06 17:42
539Pekr>> sql "select * from logs" ** Syntax Error: Invalid integer -- 0+* ** Near: (line 1) 0+*6/Dec/06"14-Dec-06 17:27
538Pekrconverting the first file (reading and saving) did not help either ... my suspicion is, there is some bug with driver ...14-Dec-06 17:27
537Pekrhere's small package - www.xidys.com/gotcha!.zip14-Dec-06 17:23
536Pekr>> do %gotcha!.r Script: "Untitled" (none) Script: "SQLite driver" (5-Nov-2006) >> sql "select * from logs" ** Syntax Error: Invalid string -- " ** Near: (line 1) È&*6/Dec/06"14-Dec-06 17:22
535Pekrhmm, it fails too ...14-Dec-06 17:15
534PekrIf I put SQL section out of the foreach file log-files, simply appending all logs at once, data is corrupted ... it is reproducable ....14-Dec-06 17:09
533Pekrfollowing works:

;--- import log files import-logs: does [ ;--- pairs of incident No and incident file [[1 filename][2 filename] atd.] ... log-files: [[1 %2006-12-06-7_50-7_59][2 %2006-12-12-15_46-15_47][3 %2006-12-13-15_29-15_31]] foreach file log-files [ log-info: copy [] log-file: read/lines file/2 ;print length? log-file foreach string-line log-file [ line: parse string-line " " if line/7 == "GET" [ append log-info reduce [line/1 line/2 line/4 line/8 line/11 to-string file/1] ] ]

SQL "BEGIN" foreach [date time ip-address url content-type incident-id] log-info [ SQL reduce ["INSERT INTO logs VALUES (?, ?, ?, ?, ?, ?)" date time ip-address url content-type incident-id] ] SQL "COMMIT"

] ]

14-Dec-06 17:08
532PekrIf I import one file at a time, clear the block, then data is OK in sqlite, but if I append first to one block, then insert into sql, data is corrupted on few random places ...14-Dec-06 17:06
531PekrI read all thre using read/lines, choose info I want, append it to resulting block. Probing block shows no defects. I believe it is a REBOL low level bug with some hidden chars. It happened on me in the past already, in different situation ...14-Dec-06 17:05
530PekrI am trying to analyse few sendmail logs. Our admin sent me three files. The first one, has those small boxes instead of newlines, you know it, when you try to open linux file under windows14-Dec-06 17:04
529PekrHi, has anyone even got to the problem, where you import data into database, and it is corrupted? (select fails)14-Dec-06 17:03
528LouisOk, it seems to be related to certain records. No matter what word I search for it is not found in certain records. So it has something to do with those records.2-Dec-06 2:20
527LouisIt does not always fail, just sometimes. I've not yet discovered why.2-Dec-06 2:14
526LouisAshley, I notice that sqlite.r value binding is missing some records when using LIKE.

>> sql ["select * from base where alamat like ?" "%Grand%"] <<=====<<< This fails. == "No rows selected." >> sql ["select * from base where alamat like '%Grand%'"] <<====<<< This finds a record.

2-Dec-06 2:13
525RobertI send you my version.26-Nov-06 15:31
524RobertI mostly use FLAT for SELECT and no refinement for INSERT.26-Nov-06 15:31
523RobertCONNECT I just use the CREATE refinement.26-Nov-06 15:30
522RobertI have created a semicolon seperated file and imported it via the SQLite command line tool. All numbers where just plain included, not guarded by " chars.26-Nov-06 15:30
521AshleyWhat did the statement that originally inserted the value look like? What refinement(s) do you use when CONNECTing? Same for both the INSERT and SELECT?26-Nov-06 13:35
520RobertAshley, no this didn't worked as well. I tried it. That's really strange. SQLite browsers see the field as NUMERIC.26-Nov-06 10:02
519IngoAnother idea could be, that you are somehow mixing "raw" and "managed" access, this bit me once, but I think it was related to strings then.26-Nov-06 9:01
518AshleyDoes:

["select * from a where mynum = ?" "1"]

work? If so, then your "integer" is in fact a string.

25-Nov-06 23:59
517RobertHow is integer! encoded for SQLite?25-Nov-06 17:42
516RobertHi, I have a problem wheren using the ? binding feature with integer! values. For example: ["select * from a where mynum = ?" 1] won't give an results. But ["select * from a where mynum = ''1'] gives results.25-Nov-06 17:41
515LouisWhoops. This should be in the RebGUI group, but I'm going to leave it here, since the script needing fixed is here.17-Nov-06 2:06
514LouisNow, how can all the fields and areas be cleared in preparation for entering data for the next record?17-Nov-06 2:02
513LouisAshley, that works. Thanks!17-Nov-06 2:01
512AshleyID field problem can be fixed by using code like:

... id/text: form i: i + 1 save %id.txt i show id

No need for parenthesis.

17-Nov-06 0:25
511AshleyYou have a few errors in there.

- your values are comma seperated (e.g. use SQL reduce ["..." val1 val2 ...] instead - tgl_nikah/text appears in your INSERT but isn't present in your display - your "DB Info" button can use ... print ROWS "base"

17-Nov-06 0:23
510LouisClick on the <DB Info> button, and you will see that the tables have been created. But I haven't been able to insert any data.

Another problem is that the id field doesn't advance to the next number.

17-Nov-06 0:03
509LouisHere's the latest version:

rebol [] do %sqlite.r do %rebgui.r unless value? 'ctx-rebgui [ either exists? %rebgui-ctx.r [do %rebgui-ctx.r] [do %rebgui.r] ] set-colors tab-size: 120x55 fonts: reduce [font-sans-serif font-fixed font-serif "verdana"]

if not exists? %id.txt [write %id.txt 1] i: to-integer read %id.txt i: i - 1 either not exists? %indodex.db [ CONNECT/create %indodex.db SQL "create table base (ID, Title, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota)" SQL "create table birthdays (ID, Nama, Jenis, Hubungan, Tgl_Lahir, Agama, Nota)" ][ CONNECT %indodex.db ] do show-cc: make function! [] [ set-colors display "IndoDex Ver. 1.0.1" [ label 16 "ID:" id: text (to-string i) return label 16 "Title:" title: drop-list 30 #W "Pak" data ["Pak" "Ibu" "Sdr." "Sdri." "Drs." "Dr." "Tuan" "Nyonya"] 20x5 return label 16 "Nama:" nama: field return label 16 "Alamat:" alamat: area 50x30 return label 16 "Telefon:" telefon: field return label 16 "Handfon:" handfon: field return label 16 "Fax:" fax: fax: field return label 16 "E-Mail:" email: field return label 16 "Nota:" nota: area 50x30 return button "Save" [ ;UNCOMMENT THE FOLLOWING LINES AND YOU WILL SEE THEY DON'T WORK. ANYBODY KNOW WHAT IS WRONG? ;SQL reduce ["insert into base values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" id/text, title/text, nama/text, alamat/text, telefon/text, handfon/text, fax/text, email/text, tgl_nikah/text, nota/text] ;SQL {insert into base values ('Pak' 'Ibu' 'Sdr.' 'Sdri.' 'Drs.' 'Dr.' 'Tuan' 'Nyonya' 'Jonew')} (i: to-integer i) (i: i + 1) (write %id.txt i) (i: to-string i) ] button "GUI Info [ print [id/text " " title/text " " nama/text " " alamat/text newline] ] button "DB Info" [ print TABLES SQLite/col-info?: true print SQL "select * from base" print SQLite/columns ] button "Halt" [ halt ] button "Quit" [ quit ] ] ] do-events

16-Nov-06 23:56
508LouisAshley, I still can't get it to work.16-Nov-06 23:56
507LouisThanks, Ashley. I just got called to dinner. When I get back I'll try that.16-Nov-06 11:10
506AshleyTry reducing the block, as in:

SQL reduce ["insert into base values (?, ?, ?, ?, ?, ?, ?, ?, ?)" ID, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota]

16-Nov-06 11:05
505LouisThis doesn't work either:

SQL ["insert into base values (?, ?, ?, ?, ?, ?, ?, ?, ?)" ID, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota]

16-Nov-06 7:33
504LouisI'm getting this:

** User Error: SQLite no such column: id ** Near: make error! reform ["SQLite" error] >>

16-Nov-06 5:34
503LouisWhat am I doing wrong here:

rebol [] do %sqlite.r do %rebgui.r

if not exists? %id.txt [write %id.txt 1]

db: %indodex.db either not exists? db [ CONNECT/create/flat/direct/format db SQL "create table base (id, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota)" SQL "create table birthdays (id, Nama, Jenis, Hubungan, Tgl_Lahir, Agama, Nota)" ][ CONNECT/flat/direct/format db ] unless value? 'ctx-rebgui [ either exists? %rebgui-ctx.r [do %rebgui-ctx.r] [do %rebgui.r] ] set-colors tab-size: 120x55 fonts: reduce [font-sans-serif font-fixed font-serif "verdana"] do show-cc: make function! [] [ display "IndoDex Ver. 1.0.1" [ tab-panel #HW data [ "Add" [ label "Title:" priority: drop-list 30 #W "Pak" data ["Pak" "Ibu" "Sdr." "Sdri." "Drs." "Dr." "Tuan" "Nyonya"] 20x5 return label "Nama:" nama: field return label "Alamat:" alamat: area 50x30 return label "Telefon" telefon: field return label "Handfon" handfon: field return label "Fax:" fax: field return label "E-Mail:" email: field return label "Nota:" nota: area 50x30 return button "Save" [ (id: to-integer read %id.txt) SQL/flat/direct {insert into base values (id, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota)} (write %id.txt id) show-text ex-status "Saved"] ] "Edit" [ ] "Search" [ ] ] ] ] do-events

16-Nov-06 5:33
502AshleyA good entry point if you just want to grab the SQL syntax is: http://www.sqlite.org/lang.html9-Nov-06 22:31
501LouisNow I've probably got my whole harddrive filled up.9-Nov-06 15:38
500LouisIt's working now. Thanks Henrik!9-Nov-06 15:36
499LouisIt does help to have the correct website. :>)9-Nov-06 15:35
498Henrikand it downloads fine here9-Nov-06 15:34
497Henrikyou probably want sqlite.org9-Nov-06 15:34
496Henriksqlite.com contains a general domain site.9-Nov-06 15:33
495Louis:>) Just tired and playing around.9-Nov-06 15:33
494Henrikof course Louis runs into an error I've never seen before9-Nov-06 15:32
493Pekr:-) Do you really find anything so valuable on sqlite.com domain, that you need to grab their whole site? :-)9-Nov-06 15:32
492LouisC:\.SQLite>wget -r -l 1 http://www.sqlite.com/index.html --23:27:13-- http://www.sqlite.com:80/index.html => `www.sqlite.com/index.html' Connecting to www.sqlite.com:80... connected! HTTP request sent, awaiting response... 23:27:14 ERROR -1: Malformed status line.9-Nov-06 15:30
491HenrikThat's right. It's very rare that wget fails to resume a download.9-Nov-06 14:30
490AntonIt's probably much better than batch-download at resuming. I should study its source to see what it knows.9-Nov-06 14:29
489Henrikwget is also very good at resuming downloads:

wget -c <very incredibly big file>

9-Nov-06 14:28
488Henrikdepth is how deep links should be gathered for downloading. Values above 3 or 4 can be dangerous. :-)9-Nov-06 14:27
487Henrikas long as you use wget in the same location as where you put your downloaded files temporarily, you don't need to set the environment variables.

Then it's just in a DOS prompt:

wget -r -l <depth> <some site>

And it will download the site to <some site>/ directory

9-Nov-06 14:26
486LouisHenrik, I'm going to try wget. Thanks.9-Nov-06 14:25
485LouisThanks, Anton. I'm going to study your script for other uses later.9-Nov-06 14:25
484Henrikhttp://pages.interlog.com/~tcharron/wgetwin.html9-Nov-06 14:23
483Henrikwget is available for windows.9-Nov-06 14:23
482AntonWell, I suppose if you do the spidering, you can supply the links to batch-download. Still, it's not designed for that. Better to get a specific tool for that.9-Nov-06 14:23
481LouisPekr, Rebolek, Will, and Henrik, thanks. I'm on XP. Too bad. DeepVacuum looks nice.9-Nov-06 14:23
480Antonbatch-download is not suited for downloading a whole website. It doesn't do any spidering.9-Nov-06 14:22
479Willand DeepVacuum is a GUI for wget ;-)9-Nov-06 13:50
478Henrikif you can use non-rebol stuff, use wget. It's very effective at mirroring sites to a local drive.9-Nov-06 13:42
477WillLouis: if you are on os x, this one work pretty neat http://www.hexcat.com/deepvacuum/index.html , it will dl the whole site and rewrite urls to make them relative, or you coud try with acrobat pro if you want a pdf version of the site9-Nov-06 13:03
476RebolekLouis: there's batch-download by Anton, try it - http://anton.wildit.net.au/rebol/util/batch-download.r9-Nov-06 12:48
475LouisCan't find any. i wrote a crude one once, but can't find it on my harddrive.9-Nov-06 12:43
474Pekrtry some of wget tools (webget). IIRC there is even some rebol based one on rebol.org iirc?9-Nov-06 12:01
473LouisI would like to download the complete sqlite website.9-Nov-06 12:00
472LouisRelated: has anyone written a script to download a complete website?9-Nov-06 11:59
471LouisThanks, Ashley. But that website has a flaw; it can't be downloaded easily. It should be either one html page or else one pdf file.9-Nov-06 11:58
470AshleyYes, see http://www.sqlite.org/lang_altertable.html9-Nov-06 11:23
469LouisMike, thanks. I'll keep playing around with it then.9-Nov-06 11:04
468MikeLLouis, It's not on the SQL92 features not supported http://www.sqlite.org/omitted.html so it must support alters.9-Nov-06 10:25
467Louisis it possible to easily add a new column to a db table already populated with data without losing that data?9-Nov-06 9:50
466HenrikCarl mentions paging. Does that not mean that you can have really big tables that are swapped to disk?8-Nov-06 8:49
465AshleyDepends on the number and size of records you wish to handle, whether ACID is important to you, and whether you need SQL access or not.8-Nov-06 6:17
464LouisThis is probably a real dumb question, but what is the advantage of SQLite over say a REBOL object database?8-Nov-06 2:53
463MaximIt also seems as if Carl is talking about a generic DB layer, such as is defined in python. so any db, could just implement a derivative of the base class and be compatible to some extent.7-Nov-06 16:26
462Pekrthere is one thing I really don't like about sqlite - it stores everything into one file. I want one file for table, one file for index, as with mysql, because for me it means simplicity - I can just look into file system and see how big some table is, or selectively backup some tables .... mySQL works that way IIRC7-Nov-06 7:34
461Pekror would you welcome including sqlite directly into rebol?7-Nov-06 7:33
460PekrI understand it the way, that we will get RIF, so you can design your own small db engine upon that. Linkintg to sqlite will be still possible using .dll, no?7-Nov-06 7:33
459BrianHFrom his blogs it appears that Carl is just extracting SQLite's btree and indexing engine, but leaving out the SQL stuff that duplicates functionality already in REBOL (think blocks and series functions). You may be able to access the data (a little unlikely), but it won't be SQLite support.6-Nov-06 22:48
458AshleyThanks Brock. Robert, looks like you've hit the same error I RAMBOed here: http://www.rebol.net/cgi-bin/rambo.r?id=4063&

A real pain as it can be consistently reproduced (and hence avoided), but with no pattern [that I can see]. If Carl implements SQLite-like support (see latest blog entry) then hopefully this will become a moot point as we won't require the library call anymore.

6-Nov-06 22:30
457AllenRobert, are you escaping the apostrophes before inserting in DB? What datatype are the strings being stored in ? nvarchar, varchar etc ?6-Nov-06 21:42
456RobertI have a problem when I import a CSV file. I read the file (1.5 -2 MB), parse it and than write it out to SQLite.

For some records I get scrambeld (invalid strings) in the database. Importing the CSV file via other SQLite tools work without any problem.

It looks like the Rebol memory somehow gets messed up. Or could it be on the way to the DLL?

6-Nov-06 8:52
455BrockBy the way Ashley, your site redesign is very nice. Good work.5-Nov-06 15:30
454Ashley1.0.1 available at: http://www.dobeash.com/download.html

Bumped version to 1.0.x as code is no longer "beta" (I actually had a few people email me about that!)

Incorporates new IMPORT function (twice as fast as a tight INSERT loop) and Robert's nested transaction handling logic (so nested BEGIN, COMMIT, END and ROLLBACK statements are correctly handled). Also changed logging behavior so all logging is off by default (i.e. use /log to turn on *all* logging).

5-Nov-06 0:03
453Ladislavaha, I overlooked it3-Nov-06 6:23
452LadislavI know that 'time is set in SQL, but it isn't used by FORMAT AFAICT3-Nov-06 6:20
451AshleyAgreed on the 2nd point, I'll remove it once I've integrated Robert's changes (which I'm doing now).2-Nov-06 22:48
450Ashley'time is set in 'sql and used by 'format2-Nov-06 22:46
449Ladislav... and the last line is "off topic" in my opinion, violating the KISS principle - it should be the caller who determines what to do next, not the called script2-Nov-06 12:58
448Ladislavit looks to me, that the TIME variable is unused?2-Nov-06 12:57
447AshleyYes please.1-Nov-06 14:07
446RobertI have made a simple change to the sqlite.r driver, so it now "supports" nested transactions in that it uses reference counting to determin when to send a BEGIN or END to SQLite. Works good. Ashley, should I mail you the changed version?1-Nov-06 8:55
445RobertSorry I mean TABLES information.15-Oct-06 10:21
444RobertHi, could it be that the COLUMNS information isn't update if I use an ATTACH command?14-Oct-06 12:45
443BrianHSQLite has a function extension mechanism, so it seems likely that you will access the extensions through that. We'll see.18-Sep-06 15:36
442BrianHThere is a virtual machine, but the code you run is native code by the time you run it. All new APIs for Windows are built on .NET.18-Sep-06 15:35
441RobertAnyway, I read it that .NET isn't required. So, it should be a drop-in-replacement. The only thing I don't know is, how to access the exteneded functions than.18-Sep-06 15:34
440RobertIt will become a replacement over time.18-Sep-06 15:34
439Pekris .NET complete API replacement for Win32? I thought it is kind of virual machine (competition to JAVA), and hence for kind of internet ready apps, but not system wide apps?18-Sep-06 15:33
438RobertPerformance will be about 50% without encryption for the SQLite extension. But I don't think that it's that much. Reading/writing to disk is a lot slower compared to execution speed of processors. So, I expect about 25% performance loss.18-Sep-06 15:33
437BrianH.NET is less crappy than Win32, believe me. I've written for both. I agree about ATI's control center though.18-Sep-06 15:32
436Pekrhopefully at home, with my XP, it is already installed, so will try it at home ...18-Sep-06 15:32
435Pekrppl should use technology where appropriate - ATI uses it for Control Center, it takes 96MB of RAM ... for what? To configure driver in nice juicy, painfully slow environment? Well, at least on 850MHz Duron, 256MB RAM, it took some 20 - 30 sec to appear :-)18-Sep-06 15:32
434Pekrit means - I use many fine apps, yet it is not on my PC ....18-Sep-06 15:30
433PekrI known none - NET is crap :-)18-Sep-06 15:30
432BrianHWhy wouldn't you have .NET installed? There are so many good apps that use it...18-Sep-06 15:29
431Pekryes, but binary dll comes in installer .msi, and it refuses to run, unless you have .NET installed, but that is detail :-)18-Sep-06 15:25
430BrianHYou can run it without the .NET framework.18-Sep-06 15:24
429Pekrhow much slower the encrypted db is?18-Sep-06 15:22
428PekrI can't install it, need to download .NET framework first, will do so at home :-)18-Sep-06 15:22
427BrianHIt appears that the SQLite version at Petr's link will work without ADO if you want to use the traditional APIs.18-Sep-06 15:18
426RobertThe strategy is to en/decrypt every block that gets written to disk. Even all B*-tree stuff etc. with this it's fully transparent to the database engine.18-Sep-06 15:16
425RobertAt the moment I tend to use the 2K$ extension. Yes, not quite cheap and I might do it myself but it will take some time too. So not being cheaper.18-Sep-06 15:15
424RobertI haven't given this ADO stuff a try to see if it fits my requirements. But will do so.18-Sep-06 15:14
423Pekrbut I found - http://sqlite.phxsoftware.com/18-Sep-06 14:34
422Pekrhmm, author offers kind of extension for 2000USD .... there is no way how poor pekr would know C code to the extent of writing such an extension myself :-)18-Sep-06 14:34
421BrianHI think that SQLite itself can be extended with encrypted fields.18-Sep-06 14:33
420Pekrthat is nearly useless then, because there is no easy way of how to protect your data18-Sep-06 14:10
419Pekrthe proper encryption would have to come at lower db level, namely - storage level ....18-Sep-06 14:10
418Pekr>> (encloak "3" "pass") > (encloak "2" "pass") == false >> "3" > "2" == true18-Sep-06 14:09
417Pekrhmm, would be problematic ....18-Sep-06 14:08
416PekrHi, I know that some talk of encryption was held here some time ago, but currently I was asked to eventually protect sqlite data and I am not sure what is correct aproach. I would not go DB-as-a-file encryption, then "unpacking" into memory, or so. I prefer app level encryption, but I am not sure about searches, using LIKE directive. Would it work?18-Sep-06 13:59
415Pekrthe log can't be used for rollbacks anyway, can it? (so not so important)2-Aug-06 5:55
414Pekranyway - inability to work directly in cgi mode will drive ppl away from driver usage .... Logging should be disabled by default imo, and the name of the variable suggests that too ....2-Aug-06 5:54
413Pekrah, so this variable applies only to disable/enable logging of sql statements, right?2-Aug-06 5:49
412Pekrwhat is log?: false good for, then?2-Aug-06 5:48
411AshleyFrom the User Guide: "Every connect, disconnect, error and statement retry is logged to %sqlite.log. This refinement adds SQL statements as well. While this can be useful to monitor what SQL statements are being issued and what the volume and distribution is; be sure to monitor the size of this file in high transaction environments."

If you really don't want any log output then just direct it to /dev/null

2-Aug-06 5:33
410Pekrsqlite is cool, so imo it would be pitty if it would not easily work in cgi environment .... if there is something wrong with my set-up, then sorry.....1-Aug-06 23:47

Return to Index Page