Re: [sqlite] New word to replace "serverless"

2020-01-28 Thread Reid Thompson
On Tue, 2020-01-28 at 10:11 +1100, John McMahon wrote:
> Define what "serverless" means to you in the SQLite context and provide
> a link or pop-up to that definition wherever "serverless" occurs in the
> documentation. Perhaps also include what it doesn't mean if you think
> this is becoming an issue.
> 
> How others choose to define "serverless" should not be your problem.
> 
> Just my pennies worth,
> John


+1 ^

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite sync over network

2019-12-05 Thread Reid Thompson
On Thu, 2019-12-05 at 12:54 +, George wrote:
> [EXTERNAL SOURCE]
> 
> 
> 
> Hi,
> I need to sync sqlite tables over network between few devices.
> Please help me with an opinion with what will be the best approach ?
> thanks,
> George
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> 
https://urldefense.proofpoint.com/v2/url?u=http-3A__mailinglists.sqlite.org_cgi-2Dbin_mailman_listinfo_sqlite-2Dusers=DwIGaQ=w8fEmIi-B5lsC0MnOiGTloUx5YmN70-3jVCmqqbXNxM=4r1gVE34nFB7YgioINuzq1cdGrlIBszDh26sKYP7ux8=ZUgwTMbyka9IuNZaXY0epvffHzRxcqMMJu6gFDi2cWQ=bFUXvciZ4M0weWnWL70V53tgL3oicufmaLQb3BWoGmI=

this may suit your needs, based on sqlite.

Bedrock was built by Expensify, and is a networking and distributed transaction 
layer built atop SQLite, the fastest, most reliable, and most widely 
distributed database in the world.

https://bedrockdb.com/


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQL Features That SQLite Does Not Implement

2019-05-22 Thread Reid Thompson
On Wed, 2019-05-22 at 14:24 -0400, Reid Thompson wrote:
> On Wed, 2019-05-22 at 19:05 +0100, Simon Slavin wrote:
> > [EXTERNAL SOURCE]
> > 
> > 
> > 
> > On 22 May 2019, at 6:51pm, sky5w...@gmail.com wrote:
> > 
> > > Please add a note to the omitted page that many basic math functions are 
> > > NOT supported. (sqrt,mod,power,stdev,etc.)
> > 
> > Which ones should the documentation mention ?  Can you find us a 
> > specification of SQL which includes that these functions ?  I'm not talking 
> > about a SQL engine you can use, but one of the SQL
> > standards which mentions them, so we know what SQLite leaves out.
> > 
> > Compare SQLite with PostgreSQL:
> > 
> > <
> > 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.postgresql.org_docs_current_functions-2Dmath.html=DwIGaQ=w8fEmIi-B5lsC0MnOiGTloUx5YmN70-3jVCmqqbXNxM=4r1gVE34nFB7YgioINuzq1cdGrlIBszDh26sKYP7ux8=jbjQXvGZh8bReMAfosQNap-8S64F4Q3WwjrDjOA9gGM=F9oXfi9o0vpUEQ6Qv_pxcKMHwuLHHbrqTRyq_uqq7_8=
> > 
> > PostgreSQL lacks sqrt (though you can do it with power() or with '|/') and 
> > stdev (which you can't do).  Both SQLite and PostgreSQL do modulo, using 
> > the '%' operator.
> > ___
> 
> 
> the referenced postgresql page lists sqrt in Mathematical Functions
> sqrt(dp or numeric)   (same as input) square root sqrt(2.0)   
> 1.4142135623731
> 
> 
> 

additionally as info,
 https://www.postgresql.org/docs/9.1/functions-aggregate.html

 lists several stddev variants in 

 Table 9-44. Aggregate Functions for Statistics


ala
[local:/home/rthompso/var]:5432 lite@lite=# select stddev(column1) from (select 
* from (values (10),(10),(100),(10)) as points) as foo;
   stddev
-
 45.
(1 row)

[local:/home/rthompso/var]:5432 lite@lite=# select stddev_pop(column1) from 
(select * from (values (10),(10),(100),(10)) as points) as foo;
 stddev_pop  
-
 38.9711431702997391
(1 row)

[local:/home/rthompso/var]:5432 lite@lite=# select stddev_samp(column1) from 
(select * from (values (10),(10),(100),(10)) as points) as foo;
 stddev_samp 
-
 45.
(1 row)





___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQL Features That SQLite Does Not Implement

2019-05-22 Thread Reid Thompson
On Wed, 2019-05-22 at 19:05 +0100, Simon Slavin wrote:
> [EXTERNAL SOURCE]
> 
> 
> 
> On 22 May 2019, at 6:51pm, sky5w...@gmail.com wrote:
> 
> > Please add a note to the omitted page that many basic math functions are 
> > NOT supported. (sqrt,mod,power,stdev,etc.)
> 
> Which ones should the documentation mention ?  Can you find us a 
> specification of SQL which includes that these functions ?  I'm not talking 
> about a SQL engine you can use, but one of the SQL
> standards which mentions them, so we know what SQLite leaves out.
> 
> Compare SQLite with PostgreSQL:
> 
> <
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.postgresql.org_docs_current_functions-2Dmath.html=DwIGaQ=w8fEmIi-B5lsC0MnOiGTloUx5YmN70-3jVCmqqbXNxM=4r1gVE34nFB7YgioINuzq1cdGrlIBszDh26sKYP7ux8=jbjQXvGZh8bReMAfosQNap-8S64F4Q3WwjrDjOA9gGM=F9oXfi9o0vpUEQ6Qv_pxcKMHwuLHHbrqTRyq_uqq7_8=
> >
> 
> PostgreSQL lacks sqrt (though you can do it with power() or with '|/') and 
> stdev (which you can't do).  Both SQLite and PostgreSQL do modulo, using the 
> '%' operator.
> ___



the referenced postgresql page lists sqrt in Mathematical Functions
sqrt(dp or numeric) (same as input) square root sqrt(2.0)   
1.4142135623731




___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP!

2018-11-13 Thread Reid Thompson
On Sun, 2018-11-11 at 00:49 +, am...@juno.com wrote:
> [EXTERNAL SOURCE]
> 
> 
> 
> November 10, 2018 Dear Good People: I work for a company that has a many 
> locations with more than one person in every location. I want to share the 
> databases I have built using SQLITE with some of
> the people in each location. Do any of you good people know is SQLITE on the 
> cloud? lf so, I  would be most appreciative if you would tell me how to 
> access it. 2) If SQLITE is on the cloud, how do I
> restrict access--so that one information (not like spelling errors) is 
> inputted, the information cannot be removed. 3) Is there a spell checker 
> function on SQLITE? ?if so, please advise very
> specifically how to find and use it. If any of you good people can help me 
> solve these dilemmas, I would be most appreciative. Thank you very much in 
> advance for helping me solve these problems.
> Respectfully yours, Alex Stavis
> 
> 

see https://bedrockdb.com

Bedrock was built by Expensify, and is a networking and distributed transaction 
layer built atop SQLite, the fastest, most reliable, and most widely 
distributed database in the world.

reid


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [Legacy Email] Re: memory leak?

2018-04-13 Thread Reid Thompson
On Thu, 2018-04-12 at 13:00 -0600, Warren Young wrote:
> [EXTERNAL SOURCE]
> 
> 
> 
> On Apr 12, 2018, at 11:14 AM, Jens Alfke  wrote:
> > 
> > I'm a Mac/iOS developer so I use the 'leaks' tool and Instruments app; I 
> > don't know how this is done on Linux.
> 
> Valgrind: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__valgrind.org_=DwIGaQ=w8fEmIi-B5lsC0MnOiGTloUx5YmN70-3jVCmqqbXNxM=jgazr1zjWOphYRYUjdZQeDxY8qk_8iVga1Rl0Pl9NMY=rF1yII94jNuHVoSMnM7
> Kf9HlTpsS50guoefTHI1PyME=w9Qpp2hG7-6tKMX_odOKaYnYVZpSFRRgtsHlHtI1LGg=
> 
> Also: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__valgrind.org_docs_manual_faq.html-23faq.pronounce=DwIGaQ=w8fEmIi-B5lsC0MnOiGTloUx5YmN70-3jVCmqqbXNxM=jgazr1zjWOphYRYUjdZQeDxY8qk_8iVga
> 1Rl0Pl9NMY=rF1yII94jNuHVoSMnM7Kf9HlTpsS50guoefTHI1PyME=jGYySPWcDyGzXECRNB_RIZ9KEIb0KA99JbnwmnjbrhM=
> 
> :)

I've found that scan-build, part of llvm/clang,  is very useful.

https://developer.arm.com/products/system-design/fast-models/docs/dui0741/latest/overview-of-the-arm-compiler-6-toolchain/clang-and-llvm-documentation

reid

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [Legacy Email] Re: Static sqlite3 library for Linux

2018-02-15 Thread Reid Thompson
https://www.sqlite.org/download.html

download
sqlite-autoconf-322.tar.gz

untar
cd into source dir

./configure
make

static lib is made by default along with shared libs

$ ls -rlt .libs/
total 9076
-rw-r--r-- 1 rthompso staff 7473704 Feb 15 11:42 sqlite3.o
-rwxr-xr-x 1 rthompso staff 4380288 Feb 15 11:42 libsqlite3.so.0.8.6
lrwxrwxrwx 1 rthompso staff  19 Feb 15 11:42 libsqlite3.so.0 -> 
libsqlite3.so.0.8.6
lrwxrwxrwx 1 rthompso staff  19 Feb 15 11:42 libsqlite3.so -> 
libsqlite3.so.0.8.6
-rw-r--r-- 1 rthompso staff 7729804 Feb 15 11:42 libsqlite3.a
-rw-r--r-- 1 rthompso staff 956 Feb 15 11:42 libsqlite3.lai
lrwxrwxrwx 1 rthompso staff  16 Feb 15 11:42 libsqlite3.la -> 
../libsqlite3.la


reid


On Thu, 2018-02-15 at 14:39 +0200, Petros Marinos wrote:
> [EXTERNAL SOURCE]
> 
> 
> 
> Greetings Peter and thank you for your answer!
> 
> Ok, I’ll give these switches a go and will get back with my findings.
> 
> Concerning the side question, of course I can answer, no problem!
> It is fully developed in-house.
> 
> Best Regards,
> Petros
> 
> On 14 Feb 2018, 20:48 +0200, petern , wrote:
> > Petros, FYI. gcc also has several different switches for object ouput:
> > eg. "gcc -c -static ..."
> > 
> > It might help to investigate these options during steps to compile sqlite.c
> > and your main program to avoid dynamic/static symbol conflicts.
> > 
> > -static
> > On systems that support dynamic linking, this prevents linking
> > with the shared libraries. On other systems, this option has no effect.
> > 
> > -shared
> > Produce a shared object which can then be linked with other
> > objects to form an executable. Not all systems support this option. For
> > predictable results,
> > you must also specify the same set of options used for
> > compilation (-fpic, -fPIC, or model suboptions) when you specify this
> > linker option.[1]
> > 
> > -shared-libgcc
> > -static-libgcc
> > On systems that provide libgcc as a shared library, these
> > options force the use of either the shared or static version,
> > respectively. If no shared version
> > of libgcc was built when the compiler was configured, these
> > options have no effect.
> > 
> > There are several situations in which an application should use
> > the shared libgcc instead of the static version. The most common of these
> > is when the
> > application wishes to throw and catch exceptions across
> > different shared libraries. In that case, each of the libraries as well as
> > the application itself
> > should use the shared libgcc.
> > 
> > Therefore, the G++ and GCJ drivers automatically add
> > -shared-libgcc whenever you build a shared library or a main executable,
> > because C++ and Java programs
> > typically use exceptions, so this is the right thing to do.
> > 
> > --
> > I have a side question for you, if you can answer.
> > How did Omilia implement their speaker independent speech recognition
> > corpus? Was it licensed from elsewhere or developed in house?
> > 
> > Peter
> > 
> > 
> > 
> > On Wed, Feb 14, 2018 at 8:27 AM, Petros Marinos  wrote:
> > 
> > > Thank you Arjen and Simon for your answers, really helpful!
> > > 
> > > While there was progress by following the two commands noted in Arjen’s
> > > answer and creating the libsqlite.a file, I stumbled upon the following
> > > errors:
> > > 
> > > [LD] astdb2sqlite3.o db1-ast/libdb1.a -> astdb2sqlite3
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o):
> > > In function `__libc_sigaction':
> > > (.text+0x89f0): multiple definition of `__libc_sigaction'
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/
> > > libc.a(sigaction.o):(.text+0x20): first defined here
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o):
> > > In function `__libc_fsync':
> > > (.text+0x8100): multiple definition of `__libc_fsync'
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc.a(fsync.o):(.text+0x0):
> > > first defined here
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o):
> > > In function `__connect_nocancel':
> > > (.text+0x7dc9): multiple definition of `__connect_nocancel'
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc.a(connect.o):(.text+0x9):
> > > first defined here
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o):
> > > In function `__libc_fcntl':
> > > (.text+0x7c40): multiple definition of `__libc_fcntl'
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc.a(fcntl.o):(.text+0xa0):
> > > first defined here
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o):
> > > In function `__fsync_nocancel':
> > > (.text+0x8109): multiple definition of `__fsync_nocancel'
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc.a(fsync.o):(.text+0x9):
> > > first defined 

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
On Tue, 2017-04-11 at 13:17 +0100, Simon Slavin wrote:
> On 11 Apr 2017, at 12:33pm, Reid Thompson <reid.thomp...@ateb.com> wrote:
> 
> > Does 'more complicated' in the below scenario mean that there is
> > potential for records to be returned more than once if I use random()?
> 
> The problem is not to do with random().  The problem is to do with modifying 
> a field used in your SELECT command.  Suppose you have an index on the column 
> "name" and you execute
> 
> SELECT name FROM treetypes ORDER BY name
> 
> with the following names
> 
> apple
> lemon
> oak
> orange
> teak
> willow
> 
> You execute _step() twice, returning the top two, then issue
> 
> UPDATE treetypes SET name="citrus" WHERE name="orange"
> 
> What do you expect SQLite to do for the SELECT ?  Should it return a list of 
> names which is clearly not in the order you asked for ?  Should it miss out 
> one of the rows even though you asked for
> them all ?  Should it return "orange" even though you have already changed 
> that value ?
> 
> That’s the "more complicated".  And for the sanity of people debugging your 
> code it’s better to ensure it never happens.
> 
> Simon.

Thanks again for the explanation. 

> That’s the "more complicated".  And for the sanity of people debugging your 
> code it’s better to ensure it never happens.

;) yes. I'm debugging some inherited code.

I/and the original implementer, am/were more familiar with PostgreSQL's
MVCC.  So I think the issue was the assumption that the query being
stepped through would only ever see the rows as they were at the start
of the query and would walk through them from first to last.

Would
PRAGMA journal_mode=WAL;
provide that?
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
> 
> Thank you.  I'll make adjustments to my process.  One follow on
> question.  This would be a concern regardless of whether random() is
> used or not in the ORDER BY clause? 
> 
> reid

sorry - I posted this before receiving/seeing Simon's response.

reid
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
On Tue, 2017-04-11 at 07:39 -0400, Richard Hipp wrote:
> On 4/11/17, Reid Thompson <reid.thomp...@ateb.com> wrote:
> > On Mon, 2017-04-10 at 21:39 +0100, Simon Slavin wrote:
> > > On 10 Apr 2017, at 9:28pm, Reid Thompson <reid.thomp...@ateb.com> wrote:
> > > 
> > > > my questions are, if I prepare and utilize a statement for a result set
> > > > in the tens of thousands (or more) using a where clause along the lines
> > > > of
> > > >    "ORDER BY batch_id, due_datetime, random()"
> > > > 
> > > > 1) As I sqlite3_step through the result set, am I guaranteed to get
> > > > each
> > > > row only once?
> > > 
> > > Yes.  _step() will return each row exactly once.  This assumes you will
> > > not make any changes to the table those rows are in until you have
> > > finished stepping.  If you make any changes to the table
> > > before the last call to _step() then things may get more complicated.
> > 
> > 
> > I have a manager process that manages the above step'ing. It gathers
> > records in batches of 30, marks them as claimed, and forwards those
> > batches to one of 50 worker processes. Each worker process performs work
> > based on each records data and when complete provides that information
> > back to the manager along with the record data.  The manager process
> > uses the returned information to update the records.  When a worker
> > completes a batche, the manager process sends them another batch. So
> > in most cases, I'm performing two updates to the record while step'ing
> > through the result set.
> 
> If you make changes to the table being queried in the middle of the
> query, then there are no guarantees.
> 
> In your case, you are *probably* ok (for now) because the ORDER BY is
> probably not being accomplished using an index.  But if batch_id and
> due_datetime are both NOT NULL and unique, then the third ORDER BY
> term will be ignored, and the UNIQUE index will be used to order the
> output.  And in that case, if any of your worker threads modify the
> batch_id or due_datetime fields, then there could be issues.
> 
> A safe work-around is to run the query into a TEMP table:
> 
>    CREATE TEMP TABLE work_to_do AS SELECT .
> 
> Then query the work_to_do table for stuff to be modified.

Thank you.  I'll make adjustments to my process.  One follow on
question.  This would be a concern regardless of whether random() is
used or not in the ORDER BY clause? 

reid
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
On Mon, 2017-04-10 at 21:39 +0100, Simon Slavin wrote:
> On 10 Apr 2017, at 9:28pm, Reid Thompson <reid.thomp...@ateb.com> wrote:
> 
> > my questions are, if I prepare and utilize a statement for a result set
> > in the tens of thousands (or more) using a where clause along the lines
> > of
> >    "ORDER BY batch_id, due_datetime, random()"
> > 
> > 1) As I sqlite3_step through the result set, am I guaranteed to get each
> > row only once?
> 
> Yes.  _step() will return each row exactly once.  This assumes you will not 
> make any changes to the table those rows are in until you have finished 
> stepping.  If you make any changes to the table
> before the last call to _step() then things may get more complicated.

Thank you Simon.

so things may get more complicated:

Does 'more complicated' in the below scenario mean that there is
potential for records to be returned more than once if I use random()?

I have a manager process that manages the above step'ing. It gathers
records in batches of 30, marks them as claimed, and forwards those
batches to one of 50 worker processes. Each worker process performs work
based on each records data and when complete provides that information
back to the manager along with the record data.  The manager process
uses the returned information to update the records.  When a worker
completes a batche, the manager process sends them another batch. So
in most cases, I'm performing two updates to the record while step'ing
through the result set.


> > 2) is the order set only once on the first sqlite3_step, or does it
> > change with each sqlite3_step invocation?
> 
> Because no index already exists for that ORDER, you can imagine that SQLite 
> makes up a temporary index for the results when you do the first 
> sqlite3_step(), and deletes it when you execute
> sqlite3_reset() or sqlite3_finalize().
> 
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_step and ORDER BY random() question.

2017-04-10 Thread Reid Thompson
hi, and thanks.

my questions are, if I prepare and utilize a statement for a result set
in the tens of thousands (or more) using a where clause along the lines
of
   "ORDER BY batch_id, due_datetime, random()"

1) As I sqlite3_step through the result set, am I guaranteed to get each
row only once?

2) is the order set only once on the first sqlite3_step, or does it
change with each sqlite3_step invocation?

thanks,
reid

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A graphical tool to handle sqlite schema change(more than ALTER TABLE)

2013-09-18 Thread Reid Thompson

On Wed, 2013-09-18 at 11:02 -0700, Bao Niu wrote:

> > > Is there a tool that allows you to graphically change sqlite schema as
> > simple
> > > as editing a spreadsheet?

https://code.google.com/p/sqlite-manager/   should meet your needs


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] What to download for SharpDevelop?

2012-01-19 Thread Reid Thompson
On Thu, 2012-01-19 at 14:46 -0500, Lou Arnold wrote:
> I read the list of downloads for SQLite, but I'm confused.

these examples may be of use
http://sqlite.phxsoftware.com/forums/p/76/266.aspx
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Reid Thompson
On 11/30/2010 9:04 PM, Simon Slavin wrote:
> Oh.  No matter.  It's the one Apple's Xcode calls and it's being very clever 
> about what language it's compiling.  It defeated my test.
>
> Simon.
a quick google query seems to imply that Xcode uses the Gnu Compiler 
Collection (gcc, g++,  gcj, gfortan, etc)   see 
http://en.wikipedia.org/wiki/GNU_Compiler_Collection the STRUCTURE 
section about midway down and http://gcc.gnu.org/ for the complete details
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Reid Thompson
On 11/30/2010 8:42 PM, Simon Slavin wrote:
> On 1 Dec 2010, at 1:33am, Jay A. Kreibich wrote:
>
>> On Wed, Dec 01, 2010 at 01:10:51AM +, Simon Slavin scratched on the wall:
>>
>>> So every C program is a C++ program,
>>   Not true.
>>
>>   Try to compile sqlite3.c with a C++ compiler and see how far you get.
> Can you explain the problem to me ?  The only C++ compiler I have here 
> handles Obj-C as well and has no problem with it.
>
which compiler are you using?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Reid Thompson
On 11/30/2010 10:18 PM, Doug wrote:
>   Objects exist in
> C++, and they don't in C
actually  objects can and do exist in C, it's just a matter of writing 
them.  C++ added the extensions to make writing/managing them easier.

  
http://www.google.com/search?q=object+oriented+programming+in+C=utf-8=utf-8=t=org.mozilla:en-US:official=firefox-a
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-05 Thread Reid Thompson
On Mon, May 03, 2010 at 03:01:26PM +0400, Alexey Pechnikov wrote:
> See http://wiki.tcl.tk/15722 Add SQLite into it - about few minuts of time.
> 
> 2010/5/3 Gilles Ganault :
> > I don't know if it'd be easier to combine existing HTTP server +
> > SQLite

ditto
http://code.google.com/p/mongoose/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread Reid Thompson
Reid Thompson wrote:
> Jean-Christophe Deschamps wrote:
>>>Now that I have a working tool to convert from Access .mdb to sqlitedb
>>> files, I need one for dBASE .dbf files. Or, a conversion to .csv will 
>>> work,
>>> too. Needs to run on linux, of course.
> 
> perhaps
> http://developer.berlios.de/projects/dbf/
>
or one of these
http://sourceforge.net/search/?type_of_search=soft=dbf
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread Reid Thompson
Jean-Christophe Deschamps wrote:
> 
>>Now that I have a working tool to convert from Access .mdb to sqlitedb
>> files, I need one for dBASE .dbf files. Or, a conversion to .csv will 
>> work,
>> too. Needs to run on linux, of course.

perhaps
http://developer.berlios.de/projects/dbf/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite server for Windows/Linux?

2009-10-26 Thread Reid Thompson
On Sat, 2009-10-24 at 16:33 +0200, Gilles Ganault wrote:
> On Sat, 24 Oct 2009 00:38:20 +0200, "Olaf Schmidt"
>  wrote:
> >Hmm in this case, what about:
> >http://www.realsoftware.com/realsqlserver/
> 
> Thanks much for the tip :) I'll give it a shot.
> 
> >So, on what platform(s) do your client-apps need to work?
> >In what (main)language do you develop your client-app?
> 
> Either Python or Delphi. Hopefully, they have connectors for those
> languages.
> 
> Thanks again.
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

may be of interest  
http://sqlrelay.sourceforge.net/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Installing SQLite

2009-07-22 Thread Reid Thompson
On Wed, Jul 22, 2009 at 01:30:58PM -0700, scabral wrote:
>
> Hi,
>
> does someone have 'good' instructions on what i need and how i need to
> install SQLite on Windows XP?
>
> I eventually want to create a desktop application to run on SQLite, but not
> sure what language i want to use yet (pythong, ruby, etc...)
>
> the instructions on the SQLite website are pretty crappy to say the least.
> When i download the zip file, all i get is 3 txt files???
>

you did something wrong.  This file

http://sqlite.org/sqlite-3_6_16.zip

from  http://sqlite.org/download.html
contains the precompiled windows binary
and this page, referenced from where the above link is
http://sqlite.org/sqlite.html
tells you how to get started

utilizing sqlite from a language requires this file
http://sqlite.org/sqlitedll-3_6_16.zip
and you have to install the appropriate bindings for your lang of choice
or configure your compilation to utilize the dll
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Re: SQLite GUI app that offers layouts

2006-10-22 Thread Reid Thompson
Jaroslaw Staniek wrote:
> T said the following, On 2006-10-18 01:47:
> 
>> There seem to be several SQLite GUI apps around. But I haven't seen 
>> any that offer building of layouts, ie positioning test frames for 
>> fields on a page for form data entry or printing. This feature is 
>> typical of proprietary apps such as FileMaker, AppleWorks, 4D etc.
>>
>> Anyone know of a GUI app that offers layouts (ie form creation), 
>> especially on a Mac (but even other platforms)?
>>
>> Is there a conventional way to store the layout information in the 
>> SQLite database itself, so it can be moved from one SQLite GUI app to 
>> another, and retain compatible forms?
> 
> This is one of Kexi features.
> 
> http://kexi-project.org
> http://en.wikipedia.org/wiki/Kexi
> 
> It works on Mac too (installable using Fink).
> 
you can also see [gnome-db,mergeant] and glom.  Gnome-DB/mergeant
supports sqlite -- I'm not sure about glom.

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



Re: [sqlite] terrible behavior

2006-03-10 Thread Reid Thompson

[EMAIL PROTECTED] wrote:

thanks

actualy the problem was in the sqlite explorer because the
column was defined as integer and any text is interpreted
as zero :-)

  

no, actually i think Guillaume was correct.
This is the query you posted:

SELECT statid
FROM plan P1
WHERE P1.curseid = 0;

Note in your data that NO curseid is equal to 0.  They are all set to 1.



[EMAIL PROTECTED] a ?crit :


hi guys
i need help :-)

what is the problem :
(SQLite version 3.3.4, win XP)

i have a table:

CREATE TABLE plan(personid INTEGER, curseid INTEGER, statid INTEGER);
INSERT INTO plan VALUES(1,1,0);
INSERT INTO plan VALUES(2,1,0);
INSERT INTO plan VALUES(3,1,0);
INSERT INTO plan VALUES(4,1,NULL);
INSERT INTO plan VALUES(5,1,NULL);
INSERT INTO plan VALUES(6,1,NULL);
INSERT INTO plan VALUES(7,1,NULL);
INSERT INTO plan VALUES(8,1,NULL);
-- ...

and i need to select all rows with "statid" = 0
so the query is :
SELECT statid
FROM plan P1
WHERE P1.curseid = 0;

BUT what a surprise, i got an empty result (i expect to
  

get


rows No 1 to 3) !

any suggestions?
  

Yes :
SELECT P1.statid
FROM plan P1
WHERE P1.statid = 0;

instead of your query...

but you'll get only what you asked for : only O ;)


--

Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
T?l : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com









-

Slon.bg ™
Симпатичният магазин за
книги, DVD, игри и музика
http://www.slon.bg


  




Re: [sqlite] Book recommendation

2005-11-10 Thread Reid Thompson

Reid Thompson wrote:

Alfredo Cole wrote:


El Miércoles, 9 de Noviembre de 2005 14:21, Joe Halpin escribió:
 > I'm looking for a good tutorial (online or paper) to help me get the
 > concepts behind using the C/C++ API. Could anyone recommend the 
book by

 > Chris Newman "SQLite: A practical guide to using, administering and
 > programming the database bundled with PHP5"?
 >
 > I'm looking primarily to use the API rather than the command line 
tool.

 >
 > Thanks
 >
 > Joe

It's a good book. Get the paperback edition, unless you are using 
Windows and want to save money. There is no Acrobat reader for ebooks 
on Linux.


Regards.


Adobe does provide Acrobat Reader for LINUX.

there's also xpdf.  and google may provide others


RE: [sqlite] Dotnet C# support

2005-10-28 Thread Reid Thompson
Original Message
From: Darren Lodge [mailto:[EMAIL PROTECTED]
Sent: Friday, October 28, 2005 4:01 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Dotnet C# support

> Hi there,
> 
> Is there a version which will work for dotnot?
> 
> Darren Lodge
> Software Engineer
> CAP
> 
> 0113 222 2058 (direct)
> 0113 222 2000 (switchboard)
> 0113 222 2001 (fax)

http://docs.codehaus.org/display/BOO/SQLite+Database

reid


RE: [sqlite] Dotnet C# support

2005-10-28 Thread Reid Thompson
Original Message
From: Darren Lodge [mailto:[EMAIL PROTECTED]
Sent: Friday, October 28, 2005 4:01 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Dotnet C# support

> Hi there,
> 
> Is there a version which will work for dotnot?
> 
> Darren Lodge
> Software Engineer
> CAP
> 
> 0113 222 2058 (direct)
> 0113 222 2000 (switchboard)
> 0113 222 2001 (fax)

http://sourceforge.net/projects/adodotnetsqlite

http://www.phpguru.org/static/SQLite.NET.html

reid


Re: [sqlite] Convert SQLite to Java

2005-10-26 Thread Reid Thompson

Steve O'Hara wrote:


I have used SQLite in a whole bundle of applications and I love it.
However, I've got an app that's being written in Java -  I've got a JNI
library (Solaris & Windows) for SQLite, but I really want something
platform independent.

I've been worn down by my quest for a comparable product to SQLite
written in pure Java and have come to the conclusion that it doesn't
exit.  I've looked at Derby, QED, Axion, blah blah and I'm not too
impressed by any of them.
None of them are as good as SQLite and they all use multiple files for
their storage.

My next port of call is to look at the feasibility of converting the
SQLite source into Java!  
I'd like to know whether a) anyone has tried this before, b) what might

be the pitfalls and c) am I being completely mental in even thinking
about trying this?

Steve




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
rg] On Behalf Of Martin Engelschalk
Sent: 24 October 2005 20:32
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] glibc detected...

Hi,

As Christian said, probably your heap is corrupted. Your backtrace 
clearly indicates that.

The typical errors that lead to this are
- you free() some memory twice
- you free more or less memory than you malloc() ed
- you overrun a buffer on the heap

valgrind is a good tool to detect such mistakes.

Martin

[EMAIL PROTECTED] schrieb:

 


tanx for the advice...but how to avoid heap corruption? and why does it
   


happen?
 


anyway, finally here is the backtrace:

*** glibc detected *** malloc(): memory corruption: 0x0808e078 ***

Program received signal SIGABRT, Aborted.
[Switching to Thread -1213548864 (LWP 4348)]
0xe410 in __kernel_vsyscall ()
(gdb) ba
#0  0xe410 in __kernel_vsyscall ()
#1  0x4fad57d5 in raise () from /lib/tls/libc.so.6
#2  0x4fad7149 in abort () from /lib/tls/libc.so.6
#3  0x4fb0927a in __libc_message () from /lib/tls/libc.so.6
#4  0x4fb1049c in _int_malloc () from /lib/tls/libc.so.6
#5  0x4fb11f01 in malloc () from /lib/tls/libc.so.6
#6  0xb7d95c03 in sqlite3Malloc (n=-16) at ./src/util.c:296
#7  0xb7d885f2 in sqlite3ParserAlloc (
  mallocProc=0xb7d95bdc ) at parse.c:1302
#8  0xb7d9382d in sqlite3RunParser (pParse=0xb550,
  zSql=0x8093c38 "SELECT subjNum FROM \"images\" WHERE id==15;",
  pzErrMsg=0xb54c) at ./src/tokenize.c:349
#9  0xb7d8c777 in sqlite3_prepare (db=0x808d5d0,
  zSql=0x8093c38 "SELECT subjNum FROM \"images\" WHERE id==15;",
  nBytes=-1, ppStmt=0xb648, pzTail=0x0) at ./src/prepare.c:440
#10 0x0804d0ef in subjId (db=0x808d5d0, id=15, subj=0xb748,
  test=0x0) at database.c:901
#11 0x0804e8f8 in featVect (db=0x808d5d0, recog_id=1, maxEigen=0)
  at database.c:1662
#12 0x0804a26a in main (argc=5, argv=0xb864) at main.c:400
(gdb)

I also noticed that error occours even if the requested row id is every
   


time
 


the same!
So the problem occours after a certain number of iterations.
The code to read is something like this:

  sqlite3_stmt *pStmt=0;
char *sql=0;
int sql_error=0;

asprintf(, "SELECT subjNum FROM \"images\" WHERE id==%d;"
   


id);
 


if ( !sqlite3_prepare(db, sql, -1, , 0) )
{
if (sqlite3_step(pStmt)==SQLITE_ROW)
{
test = (char*) sqlite3_column_text (pStmt,0);
}
else
{
fprintf(stderr,"\nWARNING: No image associated
   


to requested id\n");
 


sql_error = 1;
}
}
else
{
fprintf(stderr, "\nERROR: SQL prepare error:\n\t%s\n",
   


sqlite3_errmsg(db));
 


sql_error=1;
}

if ( sqlite3_finalize(pStmt) != SQLITE_OK )
{
fprintf(stderr, "\nERROR: SQL finalization
   


error:\n\t%s\n", sqlite3_errmsg(db));
 


sql_error=1;
}

free(sql);

if (sql_error)
{
sqlite3_close (db);
exit(1);
}

it is inside a function that is called iteratively from another
   


function,
 


incrementing the passed id num
tanks

__
TISCALI ADSL
Solo con Tiscali Adsl navighi senza limiti e telefoni senza canone 
Telecom a partire da 19,95 Euro/mese.

Attivala subito, I PRIMI DUE MESI SONO GRATIS! CLICCA QUI:
http://abbonati.tiscali.it/adsl/sa/1e25flat_tc/





   




 

Does blah, blah include hsqldb/hypersonicsql?   100% java + sql 
compliant, acid comliant and i think it stores everything in one file, 
can also load and run in memory.  been a while since i looked at it.


Re: [sqlite] Easyer way ?

2005-09-24 Thread Reid Thompson

Puneet Kishor wrote:



You will need to type the values at least once to convert from paper 
to bits, but you need not type in the INSERT command. Type them in 
Excel, or in a text editor... save the file as a CSV file, then load 
the file in SQLite (I believe there is a command to load CSV... if 
not, use the editor's capability to add the INSERT INTO car bit with 
the correct parens and quotes, etc.).


Make sure to quote the text, and not the numbers. Make sure the values 
are in the same order as the columns, and you won't even have to name 
the columns.


Puneet Kishor

This is going to be your quickest way -- unless you have a VERY good OCR 
program that can give you a head start.


Re: [sqlite] Easyer way ?

2005-09-23 Thread Reid Thompson

Richard Nagle wrote:


is there a easier way of typing in data to Sqlite.

sqlite> insert into car (md_num, md_name, style, year)
   ...> values (1, 'Honda', 'Coupe', 1983)
   ...> ;

Man, just 806 more listing
just looking for some short cuts, or helper apps...etc.
to cut down some of the typing.

Thanks -
Richard


do you already have the data in another format?
csv?, excel?, space delimited?
just about any consistent format can be handled via one of many of the 
scripting languages.


Re: [sqlite] weird problem with windows 2000 PLEASE HELP!!!

2005-09-17 Thread Reid Thompson


So, if I'm reading your message right,  the 25 seconds for inserting 
200 (that is only 200 messsages)  into a database under win 2000 is 
correct???
Perhaps it's just my  uneducated opinion but your explanation sounds 
bogus...  Why would the folks who wrote SQLITE show it off as being 
so fast if, under win 2000, it only added 200 records every 25 
seconds
And, why does adding a begin: / end:commit: around the whole loop 
speed up the operations so drastically???


just realized also, clock() is probably NOT what you want to use for 
your test. 
You probably want to use time() or gettimeofday().

Clock determines processor time used:

*NAME*
  clock  - Determine processor time 


*SYNOPSIS*
  *#include *

  *clock_t clock (void);*

*DESCRIPTION*
  The *clock () *function returns an 
approximation of processor time  used by
  the program.

*RETURN VALUE*
  The value returned is the CPU time  
used so far as  a *clock_t*; to get the
  number   of  seconds  used,  
divide by *CLOCKS_PER_SEC*.   If the 
processor
  time  used is not available or 
its  value  cannot  be  represented,  the
  function returns the value (clock_t)-1.

As info -- a correlating test with   
---

PostgreSQL 8.1beta1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.3

on a Dell laptop 256MB RAM, hdparm -W0 ( write caching off).
dmesg | grep processor => Detected 697.025 MHz processor.

$ ./a.out
added 200 records to notes
time1: 1126994873 time2: 1126994876
elapsed time: 3
seconds: 3  end_microsecs:  813272 start_microsecs 905119 microsecs -91847
..takes between 3 and 4 seconds

Second run wrapped in transaction:
$ ./a.out
added 200 records to notes
time1: 1126994915 time2: 1126994915
elapsed time: 0
seconds: 0  end_microsecs:  237435 start_microsecs 180558 microsecs 56877
..takes 56877 microseconds


#include 
#include 
#include 
#include "libpq-fe.h"

static void
exit_nicely (PGconn * conn)
{
 PQfinish (conn);
 exit (1);
}

int
main (int argc, char **argv)
{
 time_t t1;
 time_t t2;
 struct timeval tb1;
 struct timeval tb2;
 const char *conninfo;
 PGconn *conn;
 PGresult *res;
 int nFields;
 int i;
 long t_diff;


 conninfo = "dbname = test";

 /* Make a connection to the database */
 conn = PQconnectdb (conninfo);

 /* Check to see that the backend connection was successfully made */
 if (PQstatus (conn) != CONNECTION_OK)
   {
 fprintf (stderr, "Connection to database failed: %s",
  PQerrorMessage (conn));
 exit_nicely (conn);
   }

 res = PQexec (conn, "drop table notes");
 if (PQresultStatus (res) != PGRES_COMMAND_OK)
   {
 fprintf (stderr, "drop table command failed: %s",
  PQerrorMessage (conn));
 //PQclear(res);
 //exit_nicely(conn);
   }
 PQclear (res);

 res = PQexec (conn, "create table notes(subject text)");
 if (PQresultStatus (res) != PGRES_COMMAND_OK)
   {
 fprintf (stderr, "create table command failed: %s",
  PQerrorMessage (conn));
 PQclear (res);
 exit_nicely (conn);
   }
 PQclear (res);

/* comment out BEGIN txn
 res = PQexec (conn, "BEGIN");
 if (PQresultStatus (res) != PGRES_COMMAND_OK)
   {
 fprintf (stderr, "BEGIN command failed: %s", PQerrorMessage (conn));
 PQclear (res);
 exit_nicely (conn);
   }
 PQclear (res);
*/

 (void) time ();
 (void) gettimeofday (, NULL);
 for (i = 1; i < 201; i++)
   {
 char statement[1024];
 char buffer[50];
 sprintf (buffer, "my subject%d", i);

 sprintf (statement, "%s %s%s", "insert into notes(subject) values('",
  buffer, "')");
 res = PQexec (conn, statement);
 if (PQresultStatus (res) != PGRES_COMMAND_OK)
   {
 fprintf (stderr, "insert command failed: %s",
  PQerrorMessage (conn));
 PQclear (res);
 exit_nicely (conn);
   }
 PQclear (res);
   }

/* comment out COMMIT txn
 res = PQexec (conn, "COMMIT");
 PQclear (res);
*/

 (void) time ();
 (void) gettimeofday (, NULL);

 printf ("added %d records to notes\n", i - 1);
 printf ("time1: %d time2: %d\n", t1, t2);
 printf ("elapsed time: %d\n", (t2 - t1));

 t_diff = (long) ((tb2.tv_sec - tb1.tv_sec) + (tb2.tv_usec - tb1.tv_usec));
 printf("seconds: %ld  end_microsecs:  %ld start_microsecs %ld 
microsecs %ld\n",

(tb2.tv_sec - tb1.tv_sec), tb2.tv_usec, tb1.tv_usec,
tb2.tv_usec - tb1.tv_usec);

 /* close the connection to the database and cleanup */
 PQfinish (conn);

 return 0;
}




Re: [sqlite] weird problem with windows 2000 PLEASE HELP!!!

2005-09-17 Thread Reid Thompson

dan greene wrote:

So, if I'm reading your message right,  the 25 seconds for inserting 
200 (that is only 200 messsages)  into a database under win 2000 is 
correct???
Perhaps it's just my  uneducated opinion but your explanation sounds 
bogus...  Why would the folks who wrote SQLITE show it off as being so 
fast if, under win 2000, it only added 200 records every 25 seconds
And, why does adding a begin: / end:commit: around the whole loop 
speed up the operations so drastically???


Plase help!!!??

because w/o the begin-end/commit every insert must be committed to disk 
before the next insert begins.  Within a transaction( between the begin 
and end/commit ), all the inserts are 'posted', but there is only ONE 
commit at the the end.  All RDBMS systems will perform multiple 
consecutive db actions as you've described
within a transaction faster than they will without.  As previously 
noted, the time is spend syncing the data to your drive.


Results using mod/hack of your post(see below), Windows XP, athlon 
2500XP, 512MB RAM in CYGWIN..


$ ./a
added 200 records to notes
elapsed time: 265
cyberhome: /home/rthompso>
$ vi sqlitetest.c
cyberhome: /home/rthompso>
$ gcc -L/usr/local/lib  sqlitetest.c -lsqlite3
cyberhome: /home/rthompso>
$ ./a
added 200 records to notes
elapsed time: 15

The vi between the two invocations was to add the BEGIN/COMMIT calls.

$ cat sqlitetest.c
#include 
#include 
#include 
#include 
int
main()
{
   clock_t t1;
   clock_t t2;
   int i;
   int stat;
   sqlite3 *db;
   char *errmsg = 0;

   sqlite3_open("theDB", );
   (void) sqlite3_exec(db, "create table notes(subject)", 0, 0, );
   // time the additions
   t1 = clock();
   // add some rows
   (void) sqlite3_exec(db, "BEGIN", 0, 0, );
   for (i = 1; i < 201; i++)
   {
   char *statement;
   char buffer[50];
   sprintf(buffer, "my subject%d", i);
   statement =
   sqlite3_mprintf("insert into notes(subject) values('%q');", 
buffer);

   stat = sqlite3_exec(db, statement, 0, 0, );
   if (stat != SQLITE_OK)
   {
   printf("insert error at i=%1d: %s\n", i, errmsg);
   sqlite3_free(errmsg);
   break;
   }

   sqlite3_free(statement);
   }   // for
   (void) sqlite3_exec(db, "COMMIT", 0, 0, );

   t2 = clock();
   sqlite3_close(db);
   printf("added %d records to notes\n", i - 1);
   printf("elapsed time: %d\n", (t2 - t1));
}




RE: [sqlite] tracing memroy leak

2005-09-15 Thread Reid Thompson
 
 from http://delphi.about.com/od/windowsshellapi/l/aa111503d.htm

in the WM_DESTROY Msg use PostQuitMessage(0) to end the GetMessage loop,
so Windows can clean up. When the WM_CLOSE message is sent to the
DefWndProc it calls DestroyWindow for that window. When the
DestroyWindow is called, a WM_DESTROY message is created, then the
window and all of its children are destroyed. This releases the window's
system memory used to record its properties (handle, width, height,
position, Window Proc, style, children, and many others). If
DestroyWindow is not called, then this memory with the objects
properties remains until the system is restarted. Avoid this type of
memory leak if possible. If you have a critical error and must Halt the
execution, at least try to call DestroyWindow(hForm1) for your main
window. 


WndMessageProc function, the "Window Proc"

The WndMessageProc function in the program code below, can determine
what is displayed on screen for our program's client area and how this
program responds to user and system input. I have used the function name
of "WndMessageProc" just to show you that you do not have to call it
"WndProc", as many code examples seem to imply. 
 
 

reid 

-Original Message-
From: Mark Wyszomierski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 15, 2005 3:35 PM
To: Reid Thompson
Cc: sqlite-users@sqlite.org; [EMAIL PROTECTED]
Subject: Re: [sqlite] tracing memroy leak


I traced this error down a bit, it only appears when using windows'
PostMessage() to communicate between applications. Both applications
have their own database handles for sure. When one app gets some data,
it simply uses PostMessage() to inform the other app that some data has
been received. It is at this point that if I try accessing the database
in this message handler, the memory leak occurrs. I even took the
additional precaution of creating an entirely new database handle inside
the message handler itself. If I replace PostMessage() with
SendMessage(), no leak occurrs. However, replacing PostMessage() with
SendMessage() would be a huge penalty. Any ideas why there is a problem
here? 
 
Thanks,
Mark
 
On 9/15/05, Reid Thompson <[EMAIL PROTECTED]> wrote: 

Jay Sprenkle wrote:
> The premier analysis tool that I know about is valgrind:
>
http://valgrind.org/info/about.html

splint may be of interest also  http://www.splint.org/

reid





RE: [sqlite] tracing memroy leak

2005-09-15 Thread Reid Thompson
Jay Sprenkle wrote:
> The premier analysis tool that I know about is valgrind:
> 
http://valgrind.org/info/about.html

splint may be of interest also  http://www.splint.org/

reid


RE: [sqlite] Error (config.log) while compiling SQLite

2005-09-08 Thread Reid Thompson
Richard Nagle wrote:
>> you didn't happen to ftp any files in the incorrect mode did you?
>> ascii rather than binary perhaps for the tar/tar.gz file?
>> 
> 
> Just downloaded the source, from sqlite.org
> and that it. why?
> 
> -Rick

downloading a binary file ( .tar .tgz, .bz , etc ) in ascii mode will
corrupt the file

reid


Re: [sqlite] Error (config.log) while compiling SQLite

2005-09-07 Thread Reid Thompson

Richard Nagle wrote:


Below is a snip it
of compiling sqlite using MacOS X 10.3.9
& Xcode 1.5 with XCODE updates of gcc

This would be the second time,
I wipe the hard drive, and re-install ALL,
and try this again, with the same results.

So, far no-one, was able to find the cause,
of these errors... and garbage characters.

If YOU Know, please email on or off list.


Richard



9ˆ ÈÇÓ2h?fêÁ…î˜küˆàjwöÈØŒCC•!_D?'ç''È›¿ç\D,Sy=9çòÜ"oÜ/©„? 
Ä"EÔp¯#¥U™©
o}¨ª´´d•›[1^î¢Ke?#˜fOÿåNÇ7_  p??ÍÆ•?=ìC>‡l01tv?¿(ËO…X¯¿XnÙ?m‚€$?"‹>+Xp°´!=UD¯°c?/„zD…›(«ƒv
?Ó*‡ÒöwF;>ë?mR\'<]ï„8;"zíçB?z…gåæ¿,©
¡ÃœuXÜÂòáù[Z!'[EMAIL PROTECTED])¯
G>…A´î¿>:‰=Ö:z€='äÓ€<=æzå*OÉÚÚìûú;
q?¨??Ö°¸Å>$R—?»Ëãô.A¨é&"á>:˜Îàæ@(>=( 
Q—±p€JJÃàÿ÷ËT6a0y7ÃÇ»ªƒ:,6[ö_y'RïfÏNØ°´´a'([ë$‚="Ÿ?•Ë"U]?Wöä߀!¸?–ÿÈXflÌ?
G¬æÑ( ?çË S;PATH: /bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin
9ˆ ÈÇÓ2h?fêÁ…î˜küˆàjwöÈØŒCC•!_D?'ç''È›¿ç\D,Sy=configure:1607: 
checking build system type
configure:1625: result: powerpc-apple-darwin7.9.0
configure:1633: checking host system type
configure:1647: result: powerpc-apple-darwin7.9.0
configure:1701: checking for gcc
configure:1717: found /usr/bin/gcc
configure:1727: result: gcc
configure:1971: checking for C compiler version
configure:1974: gcc --version &5
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1671)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:1977: $? = 0
configure:1979: gcc -v &5
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1671)
configure:1982: $? = 0
configure:1984: gcc -V &5
gcc: `-V' option must have argument
configure:1987: $? = 1
configure:2010: checking for C compiler default output file name
configure:2013: gccconftest.c  >&5
conftest.c:1: error: stray '\1' in program
conftest.c:1: error: parse error before numeric constant
conftest.c:1: error: stray '\366' in program
conftest.c:1: error: stray '\312' in program
conftest.c:1: error: stray '\7' in program
conftest.c:1: error: stray '\351' in program
conftest.c:1: error: stray '\202' in program
conftest.c:1: error: stray '\356' in program
conftest.c:1:9: invalid suffix "h" on integer constant
conftest.c:1: error: stray '\270' in program
conftest.c:1: error: stray '\220' in program
conftest.c:1: error: stray '\347' in program
conftest.c:1: error: stray '\311' in program
conftest.c:1: error: stray '\224' in program
conftest.c:1: error: stray '\367' in program
conftest.c:1: error: stray '\377' in program
conftest.c:2: error: stray '\1' in program
conftest.c:2: error: stray '\366' in program
conftest.c:2: error: stray '\312' in program
conftest.c:2: error: stray '\7' in program
conftest.c:2: error: stray '\351' in program
conftest.c:2: error: stray '\202' in program
conftest.c:2: error: stray '\356' in program
conftest.c:2:9: invalid suffix "h" on integer constant
conftest.c:2: error: stray '\270' in program





 


you didn't happen to ftp any files in the incorrect mode did you?
ascii rather than binary perhaps for the tar/tar.gz file?


RE: [sqlite] Linking to SQLite with Cygwin / CMake

2005-08-26 Thread Reid Thompson
Kiel W. wrote:
> Ok, I'm definately thinking this is just a problem with my
> understanding of the build process in *nix's and the quirks of Cygwin.
> 
> I am getting the following warning with the default Makefile that is
> generated. "libtool: link: warning: undefined symbols not allowed in
> i686-pc-cygwin shared libraries"
> 
> I found that this is because Windows(r) dlls can't have undefined
> symbols in them and the warning can be removed with the
> following flag:
> '-no-undefined'.  This also generates some other information
> that is not
> helpful to me (probably someone else).  However, this didn't seem to
> produce a static library (either .a or .lib).
> 
> I ran across the 'make sqlite3.dll' target in the make file and tried
> that. It succeeded without any problems and generated a .dll.  I tried
> the companion 'make sqlite3.lib' and this fails because it can't find
> impdef/implib/lib. 
> 
> If anyone as other suggestions, or steps to build a static lib under
> Cygwin I'd appreciate it, otherwise I may just bite the
> bullet and see
> about going the shared libary route.
> 
> -- Kiel

download http://www.sqlite.org/sqlite-3.2.4.tar.gz

$ wget http://www.sqlite.org/sqlite-3.2.4.tar.gz
$ tar xvfz sqlite-3.2.4.tar.gz 
$ cd sqlite-3.2.4
$ ./configure
$ make
$ ---you can do make test here
$ ls -lrt .libs
total 22310
( snip non-pertinent .o files, etc )
-rw-rw-rw-  1 Reid.Thompson Domain Users 7504336 Aug 26 13:07
libsqlite3.a
-rw-rw-rw-  1 Reid.Thompson Domain Users 761 Aug 26 13:07
libsqlite3.lai
lrwxrwxrwx  1 Reid.Thompson Domain Users  16 Aug 26 13:07
libsqlite3.la -> ../libsqlite3.la
-rw-rw-rw-  1 Reid.Thompson Domain Users  125589 Aug 26 13:07
tclsqlite.o
-rw-rw-rw-  1 Reid.Thompson Domain Users 7630154 Aug 26 13:07
libtclsqlite3.a
-rw-rw-rw-  1 Reid.Thompson Domain Users 800 Aug 26 13:07
libtclsqlite3.lai
lrwxrwxrwx  1 Reid.Thompson Domain Users  19 Aug 26 13:07
libtclsqlite3.la -> ../libtclsqlite3.la

$ make install
$ ls -lrt /usr/local/lib/*sql*
-rwx--+ 1 Reid.Thompson Domain Users 758 Aug 26  2004
/usr/local/lib/libsqlite.la
-rwx--+ 1 Reid.Thompson Domain Users 4952172 Aug 26  2004
/usr/local/lib/libsqlite.a
-rwx--+ 1 Reid.Thompson Domain Users  282624 Mar  8 13:47
/usr/local/lib/sqlite3.dll
-rwx--+ 1 Reid.Thompson Domain Users  340680 Mar  8 14:40
/usr/local/lib/libsqlite3.dll.a
-rwx--+ 1 Reid.Thompson Domain Users 1148960 Mar  8 14:46
/usr/local/lib/cygsqlite3.dll
-rwx--+ 1 Reid.Thompson Domain Users 761 Apr 12 11:52
/usr/local/lib/libsqlite3.la
-rwx--+ 1 Reid.Thompson Domain Users 6981520 Apr 12 11:52
/usr/local/lib/libsqlite3.a



reid


RE: [sqlite] Linking to SQLite with Cygwin / CMake

2005-08-25 Thread Reid Thompson
Doug Currie wrote:
>> I downloaded the raw source and ran 'configure' and 'make' from a
>> separate folder.  The resulting output I copied to /usr/lib/sqlite.
>> In it a see the bunch of .lo, .o and the two .la files
>> (libsqlite3.la, libtclsqlite3.la)

using cygwin ( when i built sqlite3 from the source, it used
--prefix=/usr/local )

WS-XP-4960: /home/rthompso> 
$ gcc -Wall  sqlite3tst.c -o testsqlite3  -lsqlite3
sqlite3tst.c:4: warning: unused parameter 'argc'
sqlite3tst.c:4: warning: unused parameter 'argv'
WS-XP-4960: /home/rthompso> 
$ cat sqlite3tst.c
#include 
#include 

int main (int argc, char **argv) {

  sqlite3 *pilotLog;
  
  sqlite3_open("logbook.dat",  );

  sqlite3_close(pilotLog);

  return 0;
}


reid


RE: [sqlite] sqlite with visual basic?

2005-08-11 Thread Reid Thompson
Scott Chapman wrote:
> Thanks Steve.
> 
> Anyone have guidance on which of these will work (well) with
> the latest
> version of VB and SQLite?
> 
> Steve O'Hara wrote:
>> Check out the WIKI, there's a myriad of possibilities.
>> 
>> 
>> -Original Message-
>> From:
>> [EMAIL PROTECTED]
>> 
> [mailto:sqlite-users-return-7016-sohara=pivotal-solutions.co.u
> [EMAIL PROTECTED] rg]On Behalf Of Scott Chapman Sent: 11 August 2005 18:43
> To: sqlite-users@sqlite.org
> Subject: [sqlite] sqlite with visual basic?
> 
> 
> I am having a look at Visual Basic Express 2005 Beta.  I haven't
> programmed VB since version 3.0 on Windows 3.1 many years ago.  I
> didn't do any database with it then. 
> 
> All of my programming these days is in Python with Postgresql or
> SQLite. 
> 
> Has anyone gotten VB and SQLite working together?
> 
> Are there some examples of this available?
> 
> Scott

http://sourceforge.net/projects/adodotnetsqlite

google on finisar sqlite.net 

reid


RE: [sqlite] info

2005-06-03 Thread Reid Thompson
Reid Thompson wrote:
> info

apologies - i was trying to get the mailing list to give me a listing of
available commands.  Trying to suspend my subscription while out of the
office.

reid


[sqlite] info

2005-06-03 Thread Reid Thompson
info



[sqlite] SQLITE 3 Make install errors -- DESTDIR variable unpopulated,...

2005-04-12 Thread Reid Thompson
This issues still exists:
http://www.mail-archive.com/sqlite-users@sqlite.org/msg06857.html

reid


RE: [sqlite] Single quotes are causing misery

2005-03-17 Thread Reid Thompson

> I read that in a NSP book awhile ago (Linux Cookbook).  It's
> faster than "%s/ //g".  Very handy.  But which problem does this
> address?  :) 
> 
> Pete

This is some PHP code on Linux.  I suspect it was originally written 
> > on a Microsoft operating system because when I edit the files, my 
> > editor reports the textfiles as being "dos" (they contain 
> > carriage-return and linefeeds at the end of each line).

reid


RE: [sqlite] Single quotes are causing misery

2005-03-17 Thread Reid Thompson
Peter Jay Salzman wrote:
> Hi Mike,
> 
> To be perfectly honest, other than being a Microsoft thing, I
> don't really know what .NET is.  Pretty pathetic, huh?  :)
> 
> This is some PHP code on Linux.  I suspect it was originally
> written on a Microsoft operating system because when I edit
> the files, my editor reports the textfiles as being "dos"
> (they contain carriage-return and linefeeds at the end of each line).
> 
> I hear you about the []; I *wish* I could use them.  Proper
> quoting inside of PHP is very painful:
> 
> 
>$query = "INSERT INTO $database_table
>   (id, day, month, date, year, category, title, body,
>   showpref) VALUES (null,
>   '" . sqlite_escape_string($_POST['the_day'])  . "',
>   '" . sqlite_escape_string($_POST['the_month']). "',
>   '" . sqlite_escape_string($_POST['the_date']) . "',
> (snip) 
> 
> The stuff that looks quoted (the middle section) is actually
> the stuff outside the language quotes, but inside the quoted
> quotes.  Gruesome.
> 
> But if I don't use sqlite_escape_string, single quotes cause
> a "SQL logic or missing database" error.
> 
> But then, if I use sqlite_escape_string, I have to test
> get_magic_quotes_gpc and use stripslashes, and Eugene
> recommended.  Hard to believe there isn't a better way of doing this!
> 
> Pete
> 
> 
> 
> On Thu 17 Mar 05,  5:59 AM,
> [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> said:
>> Are you using the SQLite .NET provider?  Just curious, anyway, SQLite
>> also supports using [ ] instead of  " " and believe me it's a good
>> thing, using " " as delimiters is a poor choice considering this
>> conflicts with almost all languages when it comes to string
>> concatenation. In fact, I recommend use [ ] over " " all of the time,
>> however, the SQLite .NET managed driver has issues with the [ ]
>> delimiter style. 
>> 
>> 
>>> I've nearly completed converting Wheatblog to sqlite.  It's been
>>> quite a learning experience!  I've come across a problem I haven't
>>> been able to figure out, though.
>>> 
>>> Whenever I made a blog post that had a forward quote character (')
>>> in either the title or the body of the post, I'd get an error.
>>> 
>>> After a little Googling, I changed my query to:
>>> 
>>> 
>>>   $query = "INSERT INTO $database_table
>>>  (id, day, month, date, year, category, title, body,
>>>  showpref)  VALUES (null, '" .
>>>  sqlite_escape_string($_POST['the_day'])  . "', '" .
>>>  sqlite_escape_string($_POST['the_month']). "', '" .
>>>  sqlite_escape_string($_POST['the_date']) . "', '" .
>>>  sqlite_escape_string($_POST['the_year']) . "', '" .
>>>  sqlite_escape_string($_POST['the_category']) . "', '" .
>>>  sqlite_escape_string($_POST['the_title']). "', '" .
>>>  sqlite_escape_string($_POST['the_body']) . "', '" .
>>> sqlite_escape_string($_POST['the_showpref']) . "')"; 
>>> 
>>>   DB_query($query, $db);
>>> 
>>> and the definition of DB_query is:
>>> 
>>> 
>>>function DB_query($cmd, $db)
>>>{
>>>   $retval = sqlite_query($db, "$cmd")
>>>  or die('Query Error: ' .
>>> sqlite_error_string(sqlite_last_error($db)));
>>> 
>>>   return $retval;
>>>}
>>> 
>>> This works in the sense that forward quotes no longer generate an
>>> error. However, whenever I print out a blog post, the forward
>>> quotes are all escaped.   So if I post: 
>>> 
>>>This contains a ' character.
>>> 
>>> The post, when printed looks like:
>>> 
>>>This contains a \' character.
>>> 
>>> What's the proper way to ensure that ' characters are properly
>>> quoted but don't show up in the output?

dos2unix "filename"  will remove the trailing carriage returns

reid


RE: [sqlite] Conversion mysql -> sqlite

2005-03-16 Thread Reid Thompson
Peter Jay Salzman wrote:
> Hi all,
> 
> I know very little about mysql and sqlite - I've only played
> around a little bit with databases, so I'm a newbie in this area.
> 
> There's a blogger called Wheatblog that I've been trying to
> convert from mysql to sqlite so I don't have to run a full
> RDMBS deamon on my underpowered machine for just a single
> blog program.
> 
> I think I've successfully replaced all the mysql calls with
> wrapper functions that use sqlite functions.  There's just a
> few bits left that are causing errors, and I'm having trouble fixing
> them. 
> 
> Here's the bit of mysql sql that creates the database used by
> Wheatblog.  It came in the Wheatblog zip file.  I'm surprised
> to see the accent grave (`):
> 
> 
>CREATE TABLE `wheatblog_categories` (
>  `id` int(11) NOT NULL auto_increment,
>  `category` varchar(30) NOT NULL default '',
>  PRIMARY KEY  (`id`)
>) TYPE=MyISAM;
> 
>CREATE TABLE `wheatblog_comments` (
>  `id` int(11) NOT NULL auto_increment,
>  `comment_author_name` varchar(100) NOT NULL default '',
>  `comment_author_email` varchar(100) NOT NULL default '',
>  `comment_author_url` varchar(100) NOT NULL default '',
>  `comment_body` mediumtext NOT NULL,
>  `post_id` int(11) NOT NULL default '0',
>  `comment_month` int(2) NOT NULL default '0',
>  `comment_date` int(2) NOT NULL default '0',
>  `comment_year` int(4) NOT NULL default '0',
>  PRIMARY KEY  (`id`)
>) TYPE=MyISAM;
> 
>CREATE TABLE `wheatblog_posts` (
>  `id` int(11) NOT NULL auto_increment,
>  `day` varchar(10) default '',
>  `month` int(2) NOT NULL default '0',
>  `date` int(2) NOT NULL default '0',
>  `year` int(4) NOT NULL default '0',
>  `category` int(1) NOT NULL default '1',
>  `showpref` tinyint(1) default '1',
>  `body` mediumtext NOT NULL,
>  `title` varchar(100) default '',
>  `number_of_comments` int(11) NOT NULL default '0',  PRIMARY
>KEY  (`id`) ) TYPE=MyISAM;
> 
>INSERT INTO `wheatblog_categories` (id, category)
>  values (null, 'unfiled');
> 
> 
> And here's how I've tried to implement it on sqlite using
> PHP.  Note that
> DB_query() is a wrapper for sqlite_query().  I've changed the
> "auto_increment" to "INTEGER PRIMARY KEY", as the FAQ said.
> I'm very new to SQL, but I guess "INTEGER PRIMARY KEY" and
> "NOT NULL" aren't separated by commas?
> 
> 
>function Create_Wheatblog_Database( $db )
>{
>   $cmd =
>   "CREATE TABLE 'wheatblog_categories' (
> 'id' INTEGER PRIMARY KEY NOT NULL,
> 'category' varchar(30) NOT NULL default '',
>   ) TYPE=MyISAM;";   <---
> 
>   echo "$cmd";
>   DB_query($cmd, $db);
> 
> 
>   $cmd =
>   "CREATE TABLE 'wheatblog_comments' (
> 'id' INTEGER PRIMARY KEY NOT NULL,
> 'comment_author_name' varchar(100) NOT NULL default '',
> 'comment_author_email' varchar(100) NOT NULL default '',
> 'comment_author_url' varchar(100) NOT NULL default '',
> 'comment_body' mediumtext NOT NULL,
> 'post_id' int(11) NOT NULL default '0',
> 'comment_month' int(2) NOT NULL default '0',
> 'comment_date' int(2) NOT NULL default '0',
> 'comment_year' int(4) NOT NULL default '0',   )
> TYPE=MyISAM;"; 
> 
>   DB_query($cmd, $db);
> 
> 
>   $cmd =
>   "CREATE TABLE 'wheatblog_posts' (
> 'id' INTEGER PRIMARY KEY NOT NULL,
> 'day' varchar(10) default '',
> 'month' int(2) NOT NULL default '0',
> 'date' int(2) NOT NULL default '0',
> 'year' int(4) NOT NULL default '0',
> 'category' int(1) NOT NULL default '1',
> 'showpref' tinyint(1) default '1',
> 'body' mediumtext NOT NULL,
> 'title' varchar(100) default '',
> 'number_of_comments' int(11) NOT NULL default '0',   )
> TYPE=MyISAM;"; 
> 
>   DB_query($cmd, $db);
> 
> 
>   $cmd =
>   "INSERT INTO 'wheatblog_categories' (id, category)
> values (null, 'unfiled');";
> 
>   DB_query($cmd, $db);
> 
>}
> 
> 
> It appears that the error is a "syntax error" near where my arrow
> (<--) is.  Can someone throw some charity my way?   Is there
> anything obviously
> wrong here?
> 
> Thanks,
> Pete

you might want to make changes along the lines of:

CREATE TABLE `wheatblog_categories` (
 `id` int(11) NOT NULL auto_increment,
 `category` varchar(30) NOT NULL default '',
 PRIMARY KEY  (`id`)
   )

to 

CREATE TABLE wheatblog_categories (
 id int(11) NOT NULL auto_increment,
 category varchar(30) NOT NULL default '',
 PRIMARY KEY  (id)
   )

reid


RE: [sqlite] Conversion mysql -> sqlite

2005-03-15 Thread Reid Thompson
Peter Jay Salzman wrote:
> Hi all,
> 
> I know very little about mysql and sqlite - I've only played
> around a little bit with databases, so I'm a newbie in this area.
> 
> There's a blogger called Wheatblog that I've been trying to
> convert from mysql to sqlite so I don't have to run a full
> RDMBS deamon on my underpowered machine for just a single
> blog program.
> 
> I think I've successfully replaced all the mysql calls with
> wrapper functions that use sqlite functions.  There's just a
> few bits left that are causing errors, and I'm having trouble fixing
> them. 
> 
> Here's the bit of mysql sql that creates the database used by
> Wheatblog.  It came in the Wheatblog zip file.  I'm surprised
> to see the accent grave (`):
> 
> 
>CREATE TABLE `wheatblog_categories` (
>  `id` int(11) NOT NULL auto_increment,
>  `category` varchar(30) NOT NULL default '',
>  PRIMARY KEY  (`id`)
>) TYPE=MyISAM;
> 
>CREATE TABLE `wheatblog_comments` (
>  `id` int(11) NOT NULL auto_increment,
>  `comment_author_name` varchar(100) NOT NULL default '',
>  `comment_author_email` varchar(100) NOT NULL default '',
>  `comment_author_url` varchar(100) NOT NULL default '',
>  `comment_body` mediumtext NOT NULL,
>  `post_id` int(11) NOT NULL default '0',
>  `comment_month` int(2) NOT NULL default '0',
>  `comment_date` int(2) NOT NULL default '0',
>  `comment_year` int(4) NOT NULL default '0',
>  PRIMARY KEY  (`id`)
>) TYPE=MyISAM;
> 
>CREATE TABLE `wheatblog_posts` (
>  `id` int(11) NOT NULL auto_increment,
>  `day` varchar(10) default '',
>  `month` int(2) NOT NULL default '0',
>  `date` int(2) NOT NULL default '0',
>  `year` int(4) NOT NULL default '0',
>  `category` int(1) NOT NULL default '1',
>  `showpref` tinyint(1) default '1',
>  `body` mediumtext NOT NULL,
>  `title` varchar(100) default '',
>  `number_of_comments` int(11) NOT NULL default '0',  PRIMARY
>KEY  (`id`) ) TYPE=MyISAM;
> 
>INSERT INTO `wheatblog_categories` (id, category)
>  values (null, 'unfiled');
> 
> 
> And here's how I've tried to implement it on sqlite using
> PHP.  Note that
> DB_query() is a wrapper for sqlite_query().  I've changed the
> "auto_increment" to "INTEGER PRIMARY KEY", as the FAQ said.
> I'm very new to SQL, but I guess "INTEGER PRIMARY KEY" and
> "NOT NULL" aren't separated by commas?
> 
> 
>function Create_Wheatblog_Database( $db )
>{
>   $cmd =
>   "CREATE TABLE 'wheatblog_categories' (
> 'id' INTEGER PRIMARY KEY NOT NULL,
> 'category' varchar(30) NOT NULL default '',
>   ) TYPE=MyISAM;";   <---
> 
>   echo "$cmd";
>   DB_query($cmd, $db);
> 
> 
>   $cmd =
>   "CREATE TABLE 'wheatblog_comments' (
> 'id' INTEGER PRIMARY KEY NOT NULL,
> 'comment_author_name' varchar(100) NOT NULL default '',
> 'comment_author_email' varchar(100) NOT NULL default '',
> 'comment_author_url' varchar(100) NOT NULL default '',
> 'comment_body' mediumtext NOT NULL,
> 'post_id' int(11) NOT NULL default '0',
> 'comment_month' int(2) NOT NULL default '0',
> 'comment_date' int(2) NOT NULL default '0',
> 'comment_year' int(4) NOT NULL default '0',   )
> TYPE=MyISAM;"; 
> 
>   DB_query($cmd, $db);
> 
> 
>   $cmd =
>   "CREATE TABLE 'wheatblog_posts' (
> 'id' INTEGER PRIMARY KEY NOT NULL,
> 'day' varchar(10) default '',
> 'month' int(2) NOT NULL default '0',
> 'date' int(2) NOT NULL default '0',
> 'year' int(4) NOT NULL default '0',
> 'category' int(1) NOT NULL default '1',
> 'showpref' tinyint(1) default '1',
> 'body' mediumtext NOT NULL,
> 'title' varchar(100) default '',
> 'number_of_comments' int(11) NOT NULL default '0',   )
> TYPE=MyISAM;"; 
> 
>   DB_query($cmd, $db);
> 
> 
>   $cmd =
>   "INSERT INTO 'wheatblog_categories' (id, category)
> values (null, 'unfiled');";
> 
>   DB_query($cmd, $db);
> 
>}
> 
> 
> It appears that the error is a "syntax error" near where my arrow
> (<--) is.  Can someone throw some charity my way?   Is there
> anything obviously
> wrong here?
> 
> Thanks,
> Pete
try changing

'number_of_comments' int(11) NOT NULL default '0',   )
> TYPE=MyISAM;"; 

to

'number_of_comments' int(11) NOT NULL default '0')

 
reid


RE: [sqlite] ticket 1147

2005-02-28 Thread Reid Thompson
Robert Simpson wrote:
>> -Original Message-
>> From: D. Richard Hipp [mailto:[EMAIL PROTECTED]
>> Sent: Monday, February 28, 2005 10:30 AM
>> To: sqlite-users@sqlite.org
>> Subject: RE: [sqlite] ticket 1147
> 
> [snip]
>> What do
>> other database engines (PostgreSQL, Oracle, MySQL) do in the way of
>> revealing the originating column for result set values?  Do they have
>> some mysterious API that I have never seen?
> 
> ODBC : SQLColAttributes() or SQLColAttribute()
> OLEDB: IColumnsRowset interface
> MySQL: mysql_stmt_result_metadata() -- didn't read too much
> into this one, but I think it's the right one

PostgreSQL
for libpq
27.3.2. Retrieving Query Result Information

These functions are used to extract information from a PGresult object
that represents a successful query result (that is, one that has status
PGRES_TUPLES_OK). For objects with other status values they will act as
though the result has zero rows and zero columns.

PQntuples

Returns the number of rows (tuples) in the query result.

int PQntuples(const PGresult *res);

PQnfields

Returns the number of columns (fields) in each row of the query
result.

int PQnfields(const PGresult *res);

PQfname

Returns the column name associated with the given column number.
Column numbers start at 0. The caller should not free the result
directly. It will be freed when the associated PGresult handle is passed
to PQclear.

char *PQfname(const PGresult *res,
  int column_number);

NULL is returned if the column number is out of range.
PQfnumber

Returns the column number associated with the given column name.

int PQfnumber(const PGresult *res,
  const char *column_name);

-1 is returned if the given name does not match any column.

The given name is treated like an identifier in an SQL command, that
is, it is downcased unless double-quoted. For example, given a query
result generated from the SQL command

select 1 as FOO, 2 as "BAR";

we would have the results:

PQfname(res, 0)  foo
PQfname(res, 1)  BAR
PQfnumber(res, "FOO")0
PQfnumber(res, "foo")0
PQfnumber(res, "BAR")-1
PQfnumber(res, "\"BAR\"")1

PQftable

Returns the OID of the table from which the given column was
fetched. Column numbers start at 0.

Oid PQftable(const PGresult *res,
 int column_number);

InvalidOid is returned if the column number is out of range, or if
the specified column is not a simple reference to a table column, or
when using pre-3.0 protocol. You can query the system table pg_class to
determine exactly which table is referenced.

The type Oid and the constant InvalidOid will be defined when you
include the libpq header file. They will both be some integer type.
PQftablecol

Returns the column number (within its table) of the column making up
the specified query result column. Query-result column numbers start at
0, but table columns have nonzero numbers.

int PQftablecol(const PGresult *res,
int column_number);

Zero is returned if the column number is out of range, or if the
specified column is not a simple reference to a table column, or when
using pre-3.0 protocol.
PQfformat

Returns the format code indicating the format of the given column.
Column numbers start at 0.

int PQfformat(const PGresult *res,
  int column_number);

Format code zero indicates textual data representation, while format
code one indicates binary representation. (Other codes are reserved for
future definition.)
PQftype

Returns the data type associated with the given column number. The
integer returned is the internal OID number of the type. Column numbers
start at 0.

Oid PQftype(const PGresult *res,
int column_number);

You can query the system table pg_type to obtain the names and
properties of the various data types. The OIDs of the built-in data
types are defined in the file src/include/catalog/pg_type.h in the
source tree.
PQfmod

Returns the type modifier of the column associated with the given
column number. Column numbers start at 0.

int PQfmod(const PGresult *res,
   int column_number);

The interpretation of modifier values is type-specific; they
typically indicate precision or size limits. The value -1 is used to
indicate "no information available". Most data types do not use
modifiers, in which case the value is always -1.
PQfsize

Returns the size in bytes of the column associated with the given
column number. Column numbers start at 0.

int PQfsize(const PGresult *res,
int column_number);

PQfsize returns the space allocated for this column in a database
row, in other words the size of the server's internal representation of
the data type. (Accordingly, it is not really very useful to clients.) A
negative value indicates the data type is variable-length.
PQbinaryTuples

Returns 1 if the PGresult contains binary data and 0 if it contains

RE: [sqlite] absolute vs. relative path to database on Cygwin

2004-12-16 Thread Reid Thompson
Greg Miller wrote:
> amead wrote:
> 
>> Are you doing this at the Cygwin prompt or Window's command prompt?
>> My installation of Cygwin doesn't recognize DOS style paths at all:
>> 
>> $ ls c:\cygwin
>> ls: c:cygwin: No such file or directory
> 
> You used a backslash, escaping the 'c' character. Notice that the
> error message refers to "c:cygwin" rather than "c:\cygwin", which
> isn't equivalent. 
> 
> Try "ls c:/cygwin" instead.
> 
http://glmiller.blogspot.com/ "If my forgeries looked as bad as the CBS
documents, it would have been 'Catch Me In Two Days'"   -- Frank
Abagnale, Jr. 

try:
mkdir /C
mount -s -x -b C: /C
ls /C

reid


RE: [sqlite] Flush to disc

2004-11-03 Thread Reid Thompson
[EMAIL PROTECTED] wrote:
> In a message dated 11/3/2004 12:20:36 PM Eastern Standard Time,
> [EMAIL PROTECTED] writes: 
> 
> How can  I make sure after an insert that everything has been flushed
> to disc? 
> 
> I  mean, I want even my program to become slower as long as I know
>  everything have been written to disc.
> 
> At the moment I am using:
> PRAGMA  default_synchronous = FULL;
> PRAGMA synchronous = FULL;
> 
> 
> And the  queries are all INSERT's without a  transaction.
> 
> 
> Thx,
> 
> KaReL (aka  Steven)
> 
> Main Webpage : _http://www.karels0ft.be/
> _ (http://www.karels0ft.be/) ICQ  #:  35217584
> 
> 
> 
> If synchronus=FULL is set. every insert without a transaction is
> flushed to disk before sqlite3_finalized is returned.  You are safe.
> 
> Wei

Unless you are using IDE disks that respond that they've written to the
disk when in fact they have not.

reid


RE: [sqlite] Is there...?

2004-09-29 Thread Reid Thompson
http://sqlitebrowser.sourceforge.net/ 

Edgardo Rossetto wrote:
> Anything like a visual manager for sqlite dbs?
> 
> or just the command line tool?
> 
> Regards,
> Edgardo

reid


[sqlite] output from a compilation of sqlite-3.0.5.tar.g on SunOS 5.8.

2004-08-31 Thread Reid Thompson
Not sure if you're interested in this, but, attached is output from a
compilation of sqlite-3.0.5.tar.g on SunOS 5.8.  with a non-default
configure.  How can I utilize the included tests against the resultant
executable?

reid



compilerOutput.doc.gz
Description: compilerOutput.doc.gz