Re: [sqlite] How is the windows binary built?

2007-04-20 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote:
> I'm using cygwin under windows XP.
> gcc version 3.4.4
> 
> I unzipped the sqlite-3.3.16.tar.gz to the directory sqlite-3.3.16.
> 
> Executed the following:
> 
> cd sqlite-3.3.16
> mkdir build
> cd build
> ./configure
> make
> 
> The resulting sqlite3.exe is 4 times bigger than the windows release in 
> sqlite-3.3.16.zip.
> 
> Can anyone explain the size difference?

The debug symbols.

  strip sqlite3.exe

The sqlite3.exe posted on the website is built with a MinGW gcc cross 
compiler hosted on Linux. It is not dependent on cygwin DLLs, unlike the
cygwin version:

# cygwin
$ cygcheck ./sqlite3.exe 
.\sqlite3.exe
  c:\cygwin\bin\cygwin1.dll
C:\WINNT\system32\ADVAPI32.DLL
  C:\WINNT\system32\NTDLL.DLL
  C:\WINNT\system32\KERNEL32.DLL
  C:\WINNT\system32\RPCRT4.DLL
  c:\cygwin\bin\cygreadline6.dll
c:\cygwin\bin\cygncurses-8.dll
C:\WINNT\system32\USER32.dll
  C:\WINNT\system32\GDI32.DLL

# MinGW
$ cygcheck ./sqlite3.exe 
.\sqlite3.exe
  C:\WINNT\system32\KERNEL32.dll
C:\WINNT\system32\NTDLL.DLL
  C:\WINNT\system32\msvcrt.dll

DLLs aside, the cygwin version has the advantage of playing nice with 
rxvt and xterm.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] DB design questions

2007-04-20 Thread Mohd Radzi Ibrahim

My 2 cents:

create table Objects(id integer primary key, name text);
create table Attributes(id integer primary key, name text);
create table ObjectAttributes(objectID integer, attributeID integer, order 
integer, type integer, value text, version text);


- Original Message - 
From: "Michael Ruck" <[EMAIL PROTECTED]>

To: 
Sent: Friday, April 20, 2007 10:10 PM
Subject: [sqlite] DB design questions



Hello,

I'm currently modelling and designing a new database according the 
following
specifications. The general idea is the ability to store arbitrary 
objects,

which have attributes of various kinds. The attributes themselves may be
multivalued. The objects being stored need to be versioned, so that 
there's

a way to go back to previous versions of an object. The objects represent
metadata of media files and the data itself comes from various automated
sources and manual editing by a user.

My current idea was the following:

- CREATE TABLE objects (id TEXT, version TEXT)
- CREATE TABLE attributes (object_id TEXT, version TEXT, name TEXT, order
INT, type INT, value TEXT)

Is there anyone who has experience with this kind of design, do you have
better ideas on modelling this kind of data?

Thanks,
Mike


-
To unsubscribe, send email to [EMAIL PROTECTED]
-






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] sqlite3 shell doesn't install correctly

2007-04-20 Thread Ulrich Schöbel
Hi all,

I've used SQLite-3.3.4 for quite a while, mostly the Tcl binding.
A few days ago I installed 3.3.15 and the Tcl binding worked fine.
Tonight I downloaded 3.3.16 and compiled it without any errors
or warnings and then installed it. When I tried to execute sqlite3
the following error appered:

sqlite3: symbol lookup error: sqlite3: undefined symbol: sqlite3_io_trace

I switched back to 3.3.15 with the same result. A switch back to
3.3.4 behaved normal.

What's wrong with 3.3.15 and 3.3.16?

Kind regards

Ulrich

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] beginner: Is posible inside a result of a function call another function for delete or update the row??

2007-04-20 Thread David A O L

Use sqlite3_libversion(). See
http://www.sqlite.org/capi3ref.html#sqlite3_libversion for details.


Im using 3.3.13, I will like if you can show a little snipped of how to go
with something like the next..

(The following at sqlite prompt)
create table some(xthing varchar, count integer);
insert into some values("hi", 0);
insert into some values("hi there", 0);
update some set count = count +1 where xthing="hi";
update some set count = count +1 where xthing="hi";
update some set count = count +1 where xthing="hi";
update some set count = count +1 where xthing="hi there";


The following in C
select * from some;
// and in the callback after print the value of count and extract a random
value...


[sqlite] How is the windows binary built?

2007-04-20 Thread rhurst2
I'm using cygwin under windows XP.
gcc version 3.4.4

I unzipped the sqlite-3.3.16.tar.gz to the directory sqlite-3.3.16.

Executed the following:

cd sqlite-3.3.16
mkdir build
cd build
./configure
make

The resulting sqlite3.exe is 4 times bigger than the windows release in 
sqlite-3.3.16.zip.

Can anyone explain the size difference?
Ray

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] beginner: Is posible inside a result of a function call another function for delete or update the row??

2007-04-20 Thread Dennis Cote

David A O L wrote:


That mean Im using sqlite version 2?? (Because it say database locked).
Like I know I have here sqlite3 I will search the way to print the 
version

of the library used...



David,

Use sqlite3_libversion(). See 
http://www.sqlite.org/capi3ref.html#sqlite3_libversion for details.


HTH
Dennis Cote

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] beginner: Is posible inside a result of a function call another function for delete or update the row??

2007-04-20 Thread David A O L

What I whant is that in // Here! I whant to update (increment, decrement,
> etc).
>
> But it say that the DB is locked...

With sqlite v2, yes. If you were using sqlite v3 you could do the
UPDATE in the SELECT callback.


That mean Im using sqlite version 2?? (Because it say database locked).
Like I know I have here sqlite3 I will search the way to print the version
of the library used...


Also an extra question, I have done a wrapper for sqlite_exec... but because
I get sometimes the msg "Database is locked", I have writed something like
this:

while ((rc = sqlite3_exec (db, x, callBack, primerArg, )) ==
SQLITE_BUSY);

I have tried after putting a counter, but aparently it is to fast a 5 count
for retry the exec...



Sorry for the "anterior way" word, was thinking that it exist anterior, but
in fact it should be "previous way"


Re: [sqlite] DB design questions

2007-04-20 Thread Mark Pirogovsky

[EMAIL PROTECTED] wrote:


Hello,

I'm currently modelling and designing a new database according the following
specifications. The general idea is the ability to store arbitrary objects,
which have attributes of various kinds. The attributes themselves may be
multivalued. The objects being stored need to be versioned, so that there's
a way to go back to previous versions of an object. The objects represent
metadata of media files and the data itself comes from various automated
sources and manual editing by a user.

 


Michael,
That approach will work OK for the simple types (str, numbers, dates, 
bool ) attribute.  And also it assumes fairly flat object structures.
How are you going to deal with the attribute which is some kind of 
Collection as you mentioned multivalue, or worth if your attribute 
points to another object ?  You can represent collection as String and 
later parse them, but I think it kind of defeats the purpose.


You can also serialize your object as XML and store those serializations 
as strings or Blobs.


All in all the SQL only databases are not very good dealing with OO 
data.  You either store fairly simple Objects into the DB or spend a lot 
of time on Mapping OO to SQL -- by time I mean a development time to 
design and implement those mapping and then runtime penalty to assemble 
and disassemble your object structures for  your application to and from DB.


For that you may need to take a look at some Object- relational 
extensions of the  databases -- Oracle has it, PostgreSQL does have 
extensions.  Or you may need to use pure OO DB or XML databases.


Just My 2c.


My current idea was the following:

- CREATE TABLE objects (id TEXT, version TEXT)
- CREATE TABLE attributes (object_id TEXT, version TEXT, name TEXT, order
INT, type INT, value TEXT)

Is there anyone who has experience with this kind of design, do you have
better ideas on modelling this kind of data?

Thanks,
Mike

 



-- Mark Pirogovsky

"Computers made it possible to make millions mistakes a second"
"Ask no questions and hear no lies"

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Problem with understanding the test suite

2007-04-20 Thread drh
Justin Fletcher <[EMAIL PROTECTED]> wrote:
> 
> As test select1-11.2.1 already produced a useful result
> for this class of test and 11.2.2 provides no additional
> tests, it is probably redundant as a test there - the
> test it's performing is actually being obscured by the
> goofy test system :-|
> 
> I'm working my way through the test suite and will need
> to identify such cases. Would it be useful to report these
> in order that they can be flagged as being obscured by the
> test system ?
> 

No.  Even though the first two values in the result are
not interesting, all four column names are.  select1-11.2.2
verifies that the four column names are coming out
correctly.
--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Show and describe

2007-04-20 Thread Dennis Cote

Michael Boldin via alt email wrote:

And for anyone else using python and pysqlite, here is now to get a list of 
table

# Python SQLite application 
from pysqlite2 import dbapi2 as sqlite


# Connect to database
path= 'C:\\'
dbname= 'dbtest.db' 
db_location= path + '\\' + dbname

db = sqlite.connect(db_location)

# Find table names
qx='select tbl_name from sqlite_master'
curs1=db.execute(qx)
qr1=curs1.fetchall()
print qr1

  

Michael,

That query should be:

   select tbl_name from sqlite_master where type='table'

since the sqlite master also holds things like index and trigger 
definitions.


HTH
Dennis Cote

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: Show and describe

2007-04-20 Thread Igor Tandetnik

Michael Boldin via alt email
 wrote:

And for anyone else using python and pysqlite, here is now to get a
list of table

# Find table names
qx='select tbl_name from sqlite_master'


You'd want something like

select tbl_name from sqlite_master where type='table';

In addition to tables, sqlite_master also refers to indexes, triggers 
and views.


Igor Tandetnik 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Problem with understanding the test suite

2007-04-20 Thread Justin Fletcher

[EMAIL PROTECTED] wrote:

Justin Fletcher <[EMAIL PROTECTED]> wrote:

do_test select1-11.2.2 {
   execsql2 {
 SELECT * FROM t3, t4;
   }
} {a 3 b 4 a 3 b 4}

Can someone explain how the test can be correct ?



This comes about because of duplicate column names.
The execsql2 procedure looks at all column names in
the result set, then returns the value associated with
each column name.  So in the example above, it looks
at columns named "a", "b", "a", and "b", in that order.
But both "a" and "b" are ambiguous names.  So it picks
the value that corresponds to the column that is last
in the list.

This is goofy, perhaps, but it is the way the test
system works.


That's good because it means that I'm not going crazy -
thanks :-)

As test select1-11.2.1 already produced a useful result
for this class of test and 11.2.2 provides no additional
tests, it is probably redundant as a test there - the
test it's performing is actually being obscured by the
goofy test system :-|

I'm working my way through the test suite and will need
to identify such cases. Would it be useful to report these
in order that they can be flagged as being obscured by the
test system ?

--
Justin Fletcher, Senior Software Engineer
Picsel Technologies Ltd Tel: +44 141 8855588
Titanium House, Kings Inch Rd, Glasgow, G51 4BP, UK Web:  www.picsel.com

This email is subject to disclaimer at http://www.picsel.com/disclaimer.html


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: Show and describe

2007-04-20 Thread Michael Boldin via alt email
Thanks Igor, this gives me what I need

In fact, 
   pragma table_info( sqlite_master );
works to give information about what is in the master table view

And for anyone else using python and pysqlite, here is now to get a list of 
table

# Python SQLite application 
from pysqlite2 import dbapi2 as sqlite

# Connect to database
path= 'C:\\'
dbname= 'dbtest.db' 
db_location= path + '\\' + dbname
db = sqlite.connect(db_location)

# Find table names
qx='select tbl_name from sqlite_master'
curs1=db.execute(qx)
qr1=curs1.fetchall()
print qr1

- Original Message 
To: sqlite-users@sqlite.org
Sent: Thursday, April 19, 2007 1:53:24 PM
Subject: Show and describe


Does SQLite have anything like SHOW and DESCRIBE (in MySQL)  I check the 
synatax documentation and it seems not.

Otherwise how can I determine date tables in a database group and columns in 
table and their type

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Problem with understanding the test suite

2007-04-20 Thread drh
Justin Fletcher <[EMAIL PROTECTED]> wrote:
> do_test select1-11.2.2 {
>execsql2 {
>  SELECT * FROM t3, t4;
>}
> } {a 3 b 4 a 3 b 4}
> 
> Can someone explain how the test can be correct ?
> 

This comes about because of duplicate column names.
The execsql2 procedure looks at all column names in
the result set, then returns the value associated with
each column name.  So in the example above, it looks
at columns named "a", "b", "a", and "b", in that order.
But both "a" and "b" are ambiguous names.  So it picks
the value that corresponds to the column that is last
in the list.

This is goofy, perhaps, but it is the way the test
system works.
--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] DB design questions

2007-04-20 Thread Andrew Finkenstadt

By having "versioned attributes" do you mean the entire set of attributes is
versioned as a group, or individually?  Is it an object's state at a
specific point in time that you want to version?

--a

On 4/20/07, Michael Ruck <[EMAIL PROTECTED]> wrote:


Hello,

I'm currently modelling and designing a new database according the
following
specifications. The general idea is the ability to store arbitrary
objects,
which have attributes of various kinds. The attributes themselves may be
multivalued. The objects being stored need to be versioned, so that
there's
a way to go back to previous versions of an object. The objects represent
metadata of media files and the data itself comes from various automated
sources and manual editing by a user.

My current idea was the following:

- CREATE TABLE objects (id TEXT, version TEXT)
- CREATE TABLE attributes (object_id TEXT, version TEXT, name TEXT, order
INT, type INT, value TEXT)

Is there anyone who has experience with this kind of design, do you have
better ideas on modelling this kind of data?

Thanks,
Mike



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] Data structure

2007-04-20 Thread Lloyd
Thank you John Stanton. This has opened new doors for me, and think it
would be helpful for others in the list too..

Thanks and Regards
Lloyd

On Thu, 2007-04-12 at 12:34 -0500, John Stanton wrote:
> We use a very simple data retrieval method for smallish datasets.  The 
> data is just stored in memory or as a memory mapped file and a 
> sequential search used.  It sounds crude but when you use a fast search 
> algorithm like Boyer-Moore it outperforms index methods up to a 
> surprisingly large number of records.  As you can imagine the code 
> footprint is miniscule and if you add regular expression logic you can 
> realize very intricate search patterns.
> 
> We use the method in conjunction with a database to achieve an enormous 
> speed increase on "LIKE" type searches.  Grep a few files to get a feel 
> for the performance.
> 
> Another method which works well for memory resident storage is to 
> implement self balancing AVL trees.  The code is simple and the 
> performance lightning fast.  With a little ingenuity you can use disk 
> storage.  Mini Sql (MSql) is a good example of how this can be effective.
> 
> As Einstein said - "Make it as simple as possible, but not too simple". 
> Applying Occam's Razor can turn bloated solutions into more 
> effective lean ones.  Typical solutions come in two sizes just like Army 
> boots - too big and too small.
> 



__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Problem with understanding the test suite

2007-04-20 Thread Justin Fletcher

Hi,

I'm doing some work with the SQLite test suite and I'm confused as to the 
purpose or correctness of a couple of the tests. A few tests have shown

up odd issues, but the following is typical of the general case.

8<
do_test select1-11.1 {
  execsql {
DELETE FROM t3;
DELETE FROM t4;
INSERT INTO t3 VALUES(1,2);
INSERT INTO t4 VALUES(3,4);
SELECT * FROM t3, t4;
  }
} {1 2 3 4}
do_test select1-11.2.1 {
  execsql {
SELECT * FROM t3, t4;
  }
} {1 2 3 4}
do_test select1-11.2.2 {
  execsql2 {
SELECT * FROM t3, t4;
  }
} {a 3 b 4 a 3 b 4}
8<

My understanding of these descriptions is that ...
  'do_test   '
 - Runs the code in  and compares its results to .
   This is collectively known as test .
  'execsql '
 - Runs the SQL in  and accumulates the results in a list,
   each column's results being appended to the results. Row boundaries
   are ignored.
  'execsql2 '
 - As execsql, above, but precedes each value by the name of the column.
   This is similar to '.mode line' at the SQL command line.

Test select1-11.1, above, populates two tables with values. The first has
the a row with 2 columns, containing 1,2; the second has a row with 2 
columns containing 3,4. It then selects the values from these. The result,

'1 2 3 4' matches the expected result.

Test select1-11.2.1 selects all elements from the list, as above. Again,
it produces the expected results '1 2 3 4'.

Test select1-11.2.2 is the test I have a problem with. The same command is
used, but is expected to precede each column with the column name. I expect
the result to be 'a 1 b 2 a 3 b 4'. The test suite expects (and gets)
'a 3 b 4 a 3 b 4'.

Either this means that my understanding of execsql2 is wrong, or the test 
suite is incorrectly testing for this case.


To be a little clearer, I equate the final test to the following sequence
in the sqlite command line :

sqlite> CREATE TABLE t3(a,b);
sqlite> CREATE TABLE t4(a,b);
sqlite> .mode line
sqlite> SELECT * FROM t3,t4;
sqlite> INSERT INTO t3 VALUES(1,2);
sqlite> INSERT INTO t4 VALUES(3,4);
sqlite> SELECT * FROM t3,t4;
a = 1
b = 2
a = 3
b = 4
sqlite>

Can someone explain how the test can be correct ?



The execsql2 function in tester.tcl is as follows :

8<
# Another procedure to execute SQL.  This one includes the field
# names in the returned list.
#
proc execsql2 {sql} {
  set result {}
  db eval $sql data {
foreach f $data(*) {
  lappend result $f $data($f)
}
  }
  return $result
}
8<

My understanding of TCL is very very rough, but I believe that the loop
'foreach f $data(*)' loops over every column name and prepends the column
name to those values in the result string. As the column names match in
the results, I think that gives the strange results.

--
Justin Fletcher, Senior Software Engineer
Picsel Technologies Ltd Tel: +44 141 8855588
Titanium House, Kings Inch Rd, Glasgow, G51 4BP, UK Web:  www.picsel.com

This email is subject to disclaimer at http://www.picsel.com/disclaimer.html


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Re: One statement column to column copy

2007-04-20 Thread Dennis Cote

Rich Rattanni wrote:



I mean't when I tried this...
update Parameters set value = (select value from WorkingParameters wp);
When you execute this, it works, but it takes the first result row
from value and copies it into all the rows of parameters.


Rich,

When you execute an update statement, the set clause is executed for 
each row in the table in turn.


for each row in table parameters
   set value = 

Your expression is a sub-select statement which returns the value of the 
first row in the workingparameters table as discussed in the 
documentation. So you end up with this:


for each row in table parameters
   set value = 

By adding a where clause to the sub-select statement, Igor was selecting 
the value from the single (or first if there are multiple) row that has 
the same id as the row in the parameters table you are updating. This 
sub-select statement returns a different value for each row in the 
parameters table.


for each row in table parameters
   set value = same as the current row of parameters>


HTH
Dennis Cote



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] DB design questions

2007-04-20 Thread Michael Ruck
Hello,

I'm currently modelling and designing a new database according the following
specifications. The general idea is the ability to store arbitrary objects,
which have attributes of various kinds. The attributes themselves may be
multivalued. The objects being stored need to be versioned, so that there's
a way to go back to previous versions of an object. The objects represent
metadata of media files and the data itself comes from various automated
sources and manual editing by a user.

My current idea was the following:

- CREATE TABLE objects (id TEXT, version TEXT)
- CREATE TABLE attributes (object_id TEXT, version TEXT, name TEXT, order
INT, type INT, value TEXT)

Is there anyone who has experience with this kind of design, do you have
better ideas on modelling this kind of data?

Thanks,
Mike


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Data structure

2007-04-20 Thread John Stanton

Lloyd,
If you want some code examples contact me and I shall send you some.
[EMAIL PROTECTED]

Lloyd wrote:

Thank you John Stanton. This has opened new doors for me, and think it
would be helpful for others in the list too..

Thanks and Regards
Lloyd

On Thu, 2007-04-12 at 12:34 -0500, John Stanton wrote:

We use a very simple data retrieval method for smallish datasets.  The 
data is just stored in memory or as a memory mapped file and a 
sequential search used.  It sounds crude but when you use a fast search 
algorithm like Boyer-Moore it outperforms index methods up to a 
surprisingly large number of records.  As you can imagine the code 
footprint is miniscule and if you add regular expression logic you can 
realize very intricate search patterns.


We use the method in conjunction with a database to achieve an enormous 
speed increase on "LIKE" type searches.  Grep a few files to get a feel 
for the performance.


Another method which works well for memory resident storage is to 
implement self balancing AVL trees.  The code is simple and the 
performance lightning fast.  With a little ingenuity you can use disk 
storage.  Mini Sql (MSql) is a good example of how this can be effective.


As Einstein said - "Make it as simple as possible, but not too simple". 
   Applying Occam's Razor can turn bloated solutions into more 
effective lean ones.  Typical solutions come in two sizes just like Army 
boots - too big and too small.







__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Journal file question

2007-04-20 Thread DragonK

On 4/19/07, Joe Wilson <[EMAIL PROTECTED]> wrote:


--- DragonK <[EMAIL PROTECTED]> wrote:
> I'm having the following problem:  a sqlite database file is on an NTFS
> filesystem, in a directory with no permissions to create new files, but
only
> to modify the original database. By using filemon i've noticed some
access
> denied errors when sqlite attempted to create the journal files.
> I've created a sepparate test case and (by using filemon again) i've
noticed
> that indeed, sqlite uses the journal file, even outside transactions (an
> insert sql was executed).
>
> My question is how can I stop this behaviour (creating/deleting the
journal)
> so that sqlite will work properly under the scenario described above
(when
> it can't create the journal)?

No problem - just create your own virtual file system in a file and
change sqlite's I/O functions:

/*
** An instance of the following structure contains pointers to all
** methods on an OsFile object.
*/
struct IoMethod {
  int (*xClose)(OsFile**);
  int (*xOpenDirectory)(OsFile*, const char*);
  int (*xRead)(OsFile*, void*, int amt);
  int (*xWrite)(OsFile*, const void*, int amt);
  int (*xSeek)(OsFile*, i64 offset);
  int (*xTruncate)(OsFile*, i64 size);
  int (*xSync)(OsFile*, int);
  void (*xSetFullSync)(OsFile *id, int setting);
  int (*xFileHandle)(OsFile *id);
  int (*xFileSize)(OsFile*, i64 *pSize);
  int (*xLock)(OsFile*, int);
  int (*xUnlock)(OsFile*, int);
  int (*xLockState)(OsFile *id);
  int (*xCheckReservedLock)(OsFile *id);
  int (*xSectorSize)(OsFile *id);
};

I don't know of any other way given your constraints.

See also: Single-file virtual file systems
http://en.wikipedia.org/wiki/Virtual_file_system


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


-
To unsubscribe, send email to [EMAIL PROTECTED]

-





Thanks everybody for answering. I'm going to move the database in a
directory with the proper permissions...






--
...it's only a matter of time...


Re: [sqlite] DB design questions

2007-04-20 Thread John Stanton
We do something like that by storing the data in TEXT format and using 
RCS to handle versioning by its reverse delta method.  It works well for 
storing notes and may be useful in your application.


A function can return the appropriate version.

Michael Ruck wrote:

Hello,

I'm currently modelling and designing a new database according the following
specifications. The general idea is the ability to store arbitrary objects,
which have attributes of various kinds. The attributes themselves may be
multivalued. The objects being stored need to be versioned, so that there's
a way to go back to previous versions of an object. The objects represent
metadata of media files and the data itself comes from various automated
sources and manual editing by a user.

My current idea was the following:

- CREATE TABLE objects (id TEXT, version TEXT)
- CREATE TABLE attributes (object_id TEXT, version TEXT, name TEXT, order
INT, type INT, value TEXT)

Is there anyone who has experience with this kind of design, do you have
better ideas on modelling this kind of data?

Thanks,
Mike


-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] beginner: Is posible inside a result of a functioncall another function for delete or update the row??

2007-04-20 Thread Michael Hooker

>>The question is: the anterior way is the only way???<<

>>I think anterior means "before"... I'm no wordsmith...<<

Yes it does: David means "what I said before", or "the foregoing".  He's 
simply asking if there is another way.


Michael Hooker

From: "Dan Kennedy" <[EMAIL PROTECTED]>
To: 
Sent: Friday, April 20, 2007 5:42 AM
Subject: Re: [sqlite] beginner: Is posible inside a result of a functioncall 
another function for delete or update the row??




On Thu, 2007-04-19 at 13:29 -0500, David A O L wrote:

I have a very basic sql statement, mainly Im printing it...

static int GuardaActividadEnArchivo(void *arg1, int argc, char **argv, 
char

**azColName){
int i;
char *nombre, *ok, *ko, *actividad;
nombre = ok = ko = actividad = 0;
for (i = 0; i < argc; i++) {
printf("%s = %s ", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
// Here!
return 0;
}


What I whant is that in // Here! I whant to update (increment, decrement,
etc).

But it say that the DB is locked...


With sqlite v2, yes. If you were using sqlite v3 you could do the
UPDATE in the SELECT callback.


What I see is that I can use arg1 like a pointer to a linked list to hold
data and then do the update...


True. That's the way to go with v2 I think.


The question is: the anterior way is the only way???


I think anterior means "before"... I'm no wordsmith...

Dan.



-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] testing with single source file

2007-04-20 Thread Dan Kennedy
On Fri, 2007-04-20 at 10:13 +0200, Jens Miltner wrote:
> Am 20.04.2007 um 09:13 schrieb Jens Miltner:
> 
> >
> > Am 01.04.2007 um 20:05 schrieb Iulian Musat:
> >
> >>
> >> [EMAIL PROTECTED] wrote:
> >>> [...]
> >>> In past releases of SQLite, we have made available a ZIP archive
> >>> with preprocessed source files.  In the future, we may change this
> >>> so that instead of a ZIP archive full of individual files, we
> >>> ship a single "sqlite3.c" source file which contains all of the
> >>> source file in a single translation unit.  By this mode of
> >>> delivery, we hope to enable users to see the performance  
> >>> improvements
> >>> we are seeing in our red bars.
> >>
> >> I just want to thanks for adding the "sqlite3.c" target to the  
> >> makefile!
> >>
> >> All tests run without problems compiled with a sqlite3.c produced  
> >> from CVS head !
> >>
> >> Few notes:
> >>
> >> 1.  I had to change the declaration of these two functions in  
> >> test7.c:
> >> void sqlite3_server_start(void);
> >> void sqlite3_server_stop(void);
> >>
> >> 2. I compiled everything using "-Wall -O3"; fixed few compiler  
> >> warnings related to unused or not initialized variables (probably  
> >> irrelevant).
> >>
> >> 3. I didn't used -DSQLITE_MEMDEBUG, so all malloc and vtab_err  
> >> tests were skipped.
> >>
> >> 4. System used: Linux, i686, gcc 3.4.2, glibc 2.3.3,  
> >> Pentium4/3.00GHz/1MB L2.
> >
> >
> >
> > Hmmh - did the same with sqlite 3.3.16 on Mac OS X 10.4 (gcc 4.0.1,  
> > PowerPC G4) and the vtab_err tests apparently were not skipped  
> > (even though I didn't defined -DSQLITE_MEMDEBUG either), since they  
> > were reported to have failed:
> 
> Sorry, my bad - I did in fact define -DSQLITE_MEMDEBUG=1 when  
> building the tests, but still - the tests fail...

Might be this:
 
  http://www.sqlite.org/cvstrac/chngview?cn=3855

If so, then it is a bug in the test module only. Does cvs head
pass at the moment?

Dan.

> >
> > vtab_err-2.373...
> > Error message returned: vtable constructor did not declare schema: e
> >
> > Expected: [1 1]
> >  Got: [999 0]
> > vtab_err-2.374...
> > Error message returned: vtable constructor did not declare schema: e
> >
> > Expected: [1 1]
> >  Got: [999 0]
> > vtab_err-2.375...
> > Error message returned: vtable constructor did not declare schema: e
> >
> > [snip]
> >
> > Failures on these tests: vtab_err-2.373 vtab_err-2.374  
> > vtab_err-2.375 vtab_err-2.376 vtab_err-2.377 vtab_err-2.378  
> > vtab_err-2.379 vtab_err-2.380 vtab_err-2.381 vtab_err-2.382  
> > vtab_err-2.383 vtab_err-2.384 vtab_err-2.385 vtab_err-2.386  
> > vtab_err-2.387 vtab_err-2.388 vtab_err-2.389 vtab_err-2.390  
> > vtab_err-2.391 vtab_err-2.392 vtab_err-2.393 vtab_err-2.394  
> > vtab_err-2.395 vtab_err-2.396 vtab_err-2.397 vtab_err-2.398  
> > vtab_err-2.399 vtab_err-2.400 vtab_err-2.401 vtab_err-2.402  
> > vtab_err-2.403 vtab_err-2.404 vtab_err-2.405 vtab_err-2.406  
> > vtab_err-2.407 vtab_err-2.408 vtab_err-2.409 vtab_err-2.410  
> > vtab_err-2.411 vtab_err-2.412 vtab_err-2.413 vtab_err-2.414  
> > vtab_err-2.415 vtab_err-2.416 vtab_err-2.417 vtab_err-2.418  
> > vtab_err-2.419 vtab_err-2.420 vtab_err-2.421 vtab_err-2.422  
> > vtab_err-2.423
> >
> >
> > Not sure whether I should be concerned - we're not using virtual  
> > tables...
> >
> > 
> >
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] testing with single source file

2007-04-20 Thread Jens Miltner


Am 20.04.2007 um 09:13 schrieb Jens Miltner:



Am 01.04.2007 um 20:05 schrieb Iulian Musat:



[EMAIL PROTECTED] wrote:

[...]
In past releases of SQLite, we have made available a ZIP archive
with preprocessed source files.  In the future, we may change this
so that instead of a ZIP archive full of individual files, we
ship a single "sqlite3.c" source file which contains all of the
source file in a single translation unit.  By this mode of
delivery, we hope to enable users to see the performance  
improvements

we are seeing in our red bars.


I just want to thanks for adding the "sqlite3.c" target to the  
makefile!


All tests run without problems compiled with a sqlite3.c produced  
from CVS head !


Few notes:

1.  I had to change the declaration of these two functions in  
test7.c:

void sqlite3_server_start(void);
void sqlite3_server_stop(void);

2. I compiled everything using "-Wall -O3"; fixed few compiler  
warnings related to unused or not initialized variables (probably  
irrelevant).


3. I didn't used -DSQLITE_MEMDEBUG, so all malloc and vtab_err  
tests were skipped.


4. System used: Linux, i686, gcc 3.4.2, glibc 2.3.3,  
Pentium4/3.00GHz/1MB L2.




Hmmh - did the same with sqlite 3.3.16 on Mac OS X 10.4 (gcc 4.0.1,  
PowerPC G4) and the vtab_err tests apparently were not skipped  
(even though I didn't defined -DSQLITE_MEMDEBUG either), since they  
were reported to have failed:


Sorry, my bad - I did in fact define -DSQLITE_MEMDEBUG=1 when  
building the tests, but still - the tests fail...





vtab_err-2.373...
Error message returned: vtable constructor did not declare schema: e

Expected: [1 1]
 Got: [999 0]
vtab_err-2.374...
Error message returned: vtable constructor did not declare schema: e

Expected: [1 1]
 Got: [999 0]
vtab_err-2.375...
Error message returned: vtable constructor did not declare schema: e

[snip]

Failures on these tests: vtab_err-2.373 vtab_err-2.374  
vtab_err-2.375 vtab_err-2.376 vtab_err-2.377 vtab_err-2.378  
vtab_err-2.379 vtab_err-2.380 vtab_err-2.381 vtab_err-2.382  
vtab_err-2.383 vtab_err-2.384 vtab_err-2.385 vtab_err-2.386  
vtab_err-2.387 vtab_err-2.388 vtab_err-2.389 vtab_err-2.390  
vtab_err-2.391 vtab_err-2.392 vtab_err-2.393 vtab_err-2.394  
vtab_err-2.395 vtab_err-2.396 vtab_err-2.397 vtab_err-2.398  
vtab_err-2.399 vtab_err-2.400 vtab_err-2.401 vtab_err-2.402  
vtab_err-2.403 vtab_err-2.404 vtab_err-2.405 vtab_err-2.406  
vtab_err-2.407 vtab_err-2.408 vtab_err-2.409 vtab_err-2.410  
vtab_err-2.411 vtab_err-2.412 vtab_err-2.413 vtab_err-2.414  
vtab_err-2.415 vtab_err-2.416 vtab_err-2.417 vtab_err-2.418  
vtab_err-2.419 vtab_err-2.420 vtab_err-2.421 vtab_err-2.422  
vtab_err-2.423



Not sure whether I should be concerned - we're not using virtual  
tables...







-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] testing with single source file

2007-04-20 Thread Jens Miltner


Am 01.04.2007 um 20:05 schrieb Iulian Musat:



[EMAIL PROTECTED] wrote:

[...]
In past releases of SQLite, we have made available a ZIP archive
with preprocessed source files.  In the future, we may change this
so that instead of a ZIP archive full of individual files, we
ship a single "sqlite3.c" source file which contains all of the
source file in a single translation unit.  By this mode of
delivery, we hope to enable users to see the performance improvements
we are seeing in our red bars.


I just want to thanks for adding the "sqlite3.c" target to the  
makefile!


All tests run without problems compiled with a sqlite3.c produced  
from CVS head !


Few notes:

1.  I had to change the declaration of these two functions in test7.c:
void sqlite3_server_start(void);
void sqlite3_server_stop(void);

2. I compiled everything using "-Wall -O3"; fixed few compiler  
warnings related to unused or not initialized variables (probably  
irrelevant).


3. I didn't used -DSQLITE_MEMDEBUG, so all malloc and vtab_err  
tests were skipped.


4. System used: Linux, i686, gcc 3.4.2, glibc 2.3.3,  
Pentium4/3.00GHz/1MB L2.




Hmmh - did the same with sqlite 3.3.16 on Mac OS X 10.4 (gcc 4.0.1,  
PowerPC G4) and the vtab_err tests apparently were not skipped (even  
though I didn't defined -DSQLITE_MEMDEBUG either), since they were  
reported to have failed:


vtab_err-2.373...
Error message returned: vtable constructor did not declare schema: e

Expected: [1 1]
 Got: [999 0]
vtab_err-2.374...
Error message returned: vtable constructor did not declare schema: e

Expected: [1 1]
 Got: [999 0]
vtab_err-2.375...
Error message returned: vtable constructor did not declare schema: e

[snip]

Failures on these tests: vtab_err-2.373 vtab_err-2.374 vtab_err-2.375  
vtab_err-2.376 vtab_err-2.377 vtab_err-2.378 vtab_err-2.379  
vtab_err-2.380 vtab_err-2.381 vtab_err-2.382 vtab_err-2.383  
vtab_err-2.384 vtab_err-2.385 vtab_err-2.386 vtab_err-2.387  
vtab_err-2.388 vtab_err-2.389 vtab_err-2.390 vtab_err-2.391  
vtab_err-2.392 vtab_err-2.393 vtab_err-2.394 vtab_err-2.395  
vtab_err-2.396 vtab_err-2.397 vtab_err-2.398 vtab_err-2.399  
vtab_err-2.400 vtab_err-2.401 vtab_err-2.402 vtab_err-2.403  
vtab_err-2.404 vtab_err-2.405 vtab_err-2.406 vtab_err-2.407  
vtab_err-2.408 vtab_err-2.409 vtab_err-2.410 vtab_err-2.411  
vtab_err-2.412 vtab_err-2.413 vtab_err-2.414 vtab_err-2.415  
vtab_err-2.416 vtab_err-2.417 vtab_err-2.418 vtab_err-2.419  
vtab_err-2.420 vtab_err-2.421 vtab_err-2.422 vtab_err-2.423



Not sure whether I should be concerned - we're not using virtual  
tables...





-
To unsubscribe, send email to [EMAIL PROTECTED]
-