Re: [sqlite] Breakpoints uncorrelated on MSVC amalgamation build

2010-09-23 Thread Virgilio Fornazin
Which MSVC compiler has this bug? There's a link to information on that ?

On Thu, Sep 23, 2010 at 10:17, Ben Harper b...@imqs.co.za wrote:

 I just discovered the MSVC compiler generates bad debug info for source
 files larger than 64k lines, which is the case with the Sqlite amalgamation.
 Does anyone know of a workaround?

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

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


Re: [sqlite] Breakpoints uncorrelated on MSVC amalgamation build

2010-09-23 Thread Virgilio Fornazin
They are still using 16-bits offsets... arghh!

On Thu, Sep 23, 2010 at 14:10, Shane Harrelson sh...@sqlite.org wrote:

 This limitation has been around for a while in the MS Visual
 debuggers...  I can't find the MSDN article that discusses it, but
 once you exceed 64k lines, all bets are off.

 Work arounds include using the canonical source to build and debug, or
 stripping comment lines, white space etc. from the amalgamation to get
 below 64k.


 HTH.
 -Shane


 On Thu, Sep 23, 2010 at 10:54 AM, Ben Harper b...@imqs.co.za wrote:
  I can't confirm this behaviour on anything other than 2010. But I seem to
 recall the same business a few months ago, when I must have been on 2008.
 
  -Original Message-
  From: sqlite-users-boun...@sqlite.org [mailto:
 sqlite-users-boun...@sqlite.org] On Behalf Of Virgilio Fornazin
  Sent: 23 September 2010 03:24 PM
  To: General Discussion of SQLite Database
  Subject: Re: [sqlite] Breakpoints uncorrelated on MSVC amalgamation build
 
  Which MSVC compiler has this bug? There's a link to information on that ?
 
  On Thu, Sep 23, 2010 at 10:17, Ben Harper b...@imqs.co.za wrote:
 
  I just discovered the MSVC compiler generates bad debug info for source
  files larger than 64k lines, which is the case with the Sqlite
 amalgamation.
  Does anyone know of a workaround?
 
  Thanks,
  Ben
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] String Vs Integer Index

2010-02-10 Thread Virgilio Fornazin
I think you should be asking 'How fast is SQLite locating a key in a integer
column index vs a string index'...

Generally, integer keys are faster in key lookups than string keys, because
comparing a integer value is a
single CMP CPU instruction versus a more-complicated string comparison (that
can be virtually unlimited in size).

On Wed, Feb 10, 2010 at 15:38, Simon Slavin slav...@bigfraud.org wrote:


 On 10 Feb 2010, at 5:19pm, Alberto Simões wrote:

  I know I can benchmark myself this question, but I am sure somebody
  did that already.
 
  Supose a table with a key that is a string (say, words from 1 to 10
  characters) or a table with a key of integers.
 
  How different is the efficiency on fetching one record on these tables?

 How are you fetching the record ?  Do you have a SELECT command that looks
 up the record using a WHERE clause matching a key value ?  Is there an index
 on the key column ?

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

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


Re: [sqlite] String Vs Integer Index

2010-02-10 Thread Virgilio Fornazin
Sure (com certeza!), because it depends on the hardware and software of your
target platform.

2010/2/10 Alberto Simões hashas...@gmail.com

 On Wed, Feb 10, 2010 at 5:42 PM, Virgilio Fornazin
 virgilioforna...@gmail.com wrote:
  I think you should be asking 'How fast is SQLite locating a key in a
 integer
  column index vs a string index'...
 
  Generally, integer keys are faster in key lookups than string keys,
 because
  comparing a integer value is a
  single CMP CPU instruction versus a more-complicated string comparison
 (that
  can be virtually unlimited in size).

 Yes, I know it should be faster.. I just would like to have an idea of
 how fast to know how relevant is an indirection table (from string to
 integer).

 But probably the best is to try and compare :P

 
  On Wed, Feb 10, 2010 at 15:38, Simon Slavin slav...@bigfraud.org
 wrote:
 
 
  On 10 Feb 2010, at 5:19pm, Alberto Simões wrote:
 
   I know I can benchmark myself this question, but I am sure somebody
   did that already.
  
   Supose a table with a key that is a string (say, words from 1 to 10
   characters) or a table with a key of integers.
  
   How different is the efficiency on fetching one record on these
 tables?
 
  How are you fetching the record ?  Do you have a SELECT command that
 looks
  up the record using a WHERE clause matching a key value ?  Is there an
 index
  on the key column ?
 
  Simon.
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 



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

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


Re: [sqlite] Data converting

2009-11-24 Thread Virgilio Fornazin
SQL does not have a specific datetime field type and also does not store it
in binary format.
You should perform the data type conversions by yourself.

On Tue, Nov 24, 2009 at 09:50, Renato Oliveira ren...@sincronica.com.brwrote:

 Hello, I'm new to SQLite, and need a query to convert a number of int
 format to format date and date format to format int.
 In PostGres the query is as follows:

 SELECT 14652:: bit (16)) 9): int + 1980) | | '-' | |
 ((14652:: bit (16)  B'0000 ') 5):: int | |' - '| |
 (14652:: bit (16)  B'0001 '):: int):: date;

 Is there a book for beginners in SQLite?

 Hugs

 Renato S. Oliveira
 Sincronica Sistemas Integrados
 +55 11 2539 0544 / 0545

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

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


Re: [sqlite] Data converting

2009-11-24 Thread Virgilio Fornazin
You should read http://www.sqlite.org/datatype3.html , may help you.

On Tue, Nov 24, 2009 at 10:48, Virgilio Fornazin virgilioforna...@gmail.com
 wrote:

 SQL does not have a specific datetime field type and also does not store it
 in binary format.
 You should perform the data type conversions by yourself.


 On Tue, Nov 24, 2009 at 09:50, Renato Oliveira 
 ren...@sincronica.com.brwrote:

 Hello, I'm new to SQLite, and need a query to convert a number of int
 format to format date and date format to format int.
 In PostGres the query is as follows:

 SELECT 14652:: bit (16)) 9): int + 1980) | | '-' | |
 ((14652:: bit (16)  B'0000 ') 5):: int | |' - '| |
 (14652:: bit (16)  B'0001 '):: int):: date;

 Is there a book for beginners in SQLite?

 Hugs

 Renato S. Oliveira
 Sincronica Sistemas Integrados
 +55 11 2539 0544 / 0545

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



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


Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Virgilio Fornazin
SELECT
field as NAME

does not work?

On Fri, Nov 13, 2009 at 12:07, Marco Bambini ma...@sqlabs.net wrote:

 sqlite 3.6.19

 CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT);
 a
 SELECT rowid, col1, col2

 returns the following column names with sqlite3_column_name:
 col1, col1, col2

 Is there a way to force the first column name to be returned as rowid and
 not as its col1 alias?

 Thanks.
 --
 Marco Bambini
 http://www.sqlabs.com
 http://www.creolabs.com/payshield/






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

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


Re: [sqlite] sqlite programmed in C++

2009-06-02 Thread Virgilio Fornazin
Because there are many platforms that sqlite runs (and can run at some time)

that doesn't have a C++ compiler available, but they always have a C
compiler.

[]'s

On Tue, Jun 2, 2009 at 12:33, Sylvain Pointeau
sylvain.point...@gmail.comwrote:

 I didn't mean to program with sqlite in C++ ...
 I just meant to introduce C++ inside SQLite instead of C...
 I would like to understand why SQLite is programmed only in C 

 Cheers,
 Sylvain

 On Tue, Jun 2, 2009 at 5:15 PM, logan.rat...@emerson.com wrote:

  One of the best and worst things about C++ is its ability to use C code
  (almost) transparently.  Best because it allows you to use things like
  SQLite seamlessly in your C++ code. Worst because it allows some
  programming idioms that are in opposition to good object oriented
  design.  But let's concentrate on the up-side.
 
  There are C++ wrappers to SQLite out there if you care to look for them,
  but depending upon the complexity of your application you may find you
  don't need them.  It is easy to contain a SQLite connection inside a
  class object, easy to compose your queries in a std::string (or a
  CString depending on your environment and preferences) and fairly easy
  to get your query results into a container class.
 
  While I would never dream of starting from scratch on anything of the
  size and complexity of SQLite without C++, the STL, and probably Boost,
  I also would never advocate fixing something that ain't broke. As an
  applications programmer you can get all the advantages of C++ without
  any changes to SQLite as written.
 
  Just my $0.02 worth.
 
  Logan Ratner | Software Engineer | Gas Chromatographs
  Emerson Process Management | 5650 Brittmoore | Houston | TX | 77041 |
  USA
  T +1 713 839 9656 | F +1 713 827 3807
 
 
  logan.rat...@emerson.com-original Message-
  From: sqlite-users-boun...@sqlite.org
  [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Sylvain Pointeau
  Sent: Tuesday, June 02, 2009 9:58 AM
  To: sqlite-users@sqlite.org
  Subject: [sqlite] sqlite programmed in C++
 
  Hello,
  I would like to know if someone already though about to introduce C++ in
  SQLite?
  I just think about a minimal subset of C++ that will not make any
  performance penalty
  (like C with classes)
 
  is it a performance issue?
  is it a deployment/compiler issue?
  or any issue?
 
  Please don't make any aggressive reply, I am a very nice guy :-)
 
  Cheers,
  Sylvain
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] A bit OT: Good CVS client for Windows

2009-02-27 Thread Virgilio Fornazin
Eclipse perform better for me than other all (Tortoise, WinCVS, etc).
Cross platform, excelent branching / merging support, visual list of
modified files, etc.

On Fri, Feb 27, 2009 at 03:51, J Jayavasanthan jayavasant...@gmail.comwrote:

 You can also use GNU WinCVS, http://www.wincvs.org/download.html
 Regards,
 Jay

 On Fri, Feb 27, 2009 at 3:07 AM, Sherief N. Farouk sher...@mganin.com
 wrote:

 
 
  On Feb 26, 2009, at 16:28, J. R. Westmoreland j...@jrw.org wrote:
 
   Can someone please give me a suggestion for a good client for CVS
   that runs
   under Windows?
  
   I have my linux system but figured it would be nice to have a client
   in both
   places, a belt and suspenders kind of person I guess.
  
  
  
   Thanks,
  
   J. R.
  
  
  
   
  
   J. R. Westmoreland
  
   E-mail: j...@jrw.org
  
  
  
   ___
   sqlite-users mailing list
   sqlite-users@sqlite.org
   http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 



 --
 first me then home
 first home then country
 first country then world
 fools always read inverse
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] SQLite Import Tool

2008-11-12 Thread Virgilio Fornazin
Hi

You can use SQLite ODBC Driver and SQL Management Studio Data Transfer
Wizard to perform this action.

On Wed, Nov 12, 2008 at 12:45 PM, Baskaran Selvaraj 
[EMAIL PROTECTED] wrote:



 Hi All,
 This is Baskaran and I am looking for a vendor tool to automate the import
 process.
 We have an application which is written to use SQLite database. Right now,
 I import the data
 into SQLite database from SQL Server 2005 manually. Looking for a vendor
 software, which can used
 to automate the process of importing the data from SQL Server 2005 to
 SQLite database
 on a daily basis
 .
 Thanks
 Baskaran Selvaraj, DBA

 _
 See how Windows(R) connects the people, information, and fun that are part of
 your life
 http://clk.atdmt.com/MRT/go/119463819/direct/01/
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-14 Thread Virgilio Fornazin
Patch posted to CVSTRAC timeline. Please take a look.

Ticket n# 3218

On Sun, Jul 13, 2008 at 11:04 AM, Virgilio Fornazin 
[EMAIL PROTECTED] wrote:

 Thanks for your quick answer... I'll take a look at it to see and submit a
 patch to cvstrac if needed.

 Also, thanks again for this great library.


 On Sun, Jul 13, 2008 at 12:47 AM, D. Richard Hipp [EMAIL PROTECTED] wrote:


 On Jul 12, 2008, at 5:34 PM, Virgilio Fornazin wrote:

  These mutex changes, with sqlite3_initialize() / finalize() calls,
  will
  solve that problem reported that SQlite3 doesn't delete Critical
  Sections
  under MS-Windows VFS ?


 The new interface is designed to solve problems such as this, though
 the application must invoke sqlite3_shutdown to make it happen.
 sqlite3_shutdown is not invoked automatically.  On the other hand, I
 do not think we have added the code to the windows VFS to do this,
 yet.  Perhaps you can suggest a patch.  The function where the patch
 would be inserted would be the sqlite3_os_end() implementation at the
 very bottom of os_win.c.

 D. Richard Hipp
 [EMAIL PROTECTED]



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



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


Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-13 Thread Virgilio Fornazin
Thanks for your quick answer... I'll take a look at it to see and submit a
patch to cvstrac if needed.

Also, thanks again for this great library.

On Sun, Jul 13, 2008 at 12:47 AM, D. Richard Hipp [EMAIL PROTECTED] wrote:


 On Jul 12, 2008, at 5:34 PM, Virgilio Fornazin wrote:

  These mutex changes, with sqlite3_initialize() / finalize() calls,
  will
  solve that problem reported that SQlite3 doesn't delete Critical
  Sections
  under MS-Windows VFS ?


 The new interface is designed to solve problems such as this, though
 the application must invoke sqlite3_shutdown to make it happen.
 sqlite3_shutdown is not invoked automatically.  On the other hand, I
 do not think we have added the code to the windows VFS to do this,
 yet.  Perhaps you can suggest a patch.  The function where the patch
 would be inserted would be the sqlite3_os_end() implementation at the
 very bottom of os_win.c.

 D. Richard Hipp
 [EMAIL PROTECTED]



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

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


Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-12 Thread Virgilio Fornazin
These mutex changes, with sqlite3_initialize() / finalize() calls, will
solve that problem reported that SQlite3 doesn't delete Critical Sections
under MS-Windows VFS ?


On Sat, Jul 12, 2008 at 6:00 PM, D. Richard Hipp [EMAIL PROTECTED] wrote:

 The current plan is to release SQLite version 3.6.0 on Wednesday,
 2008-07-16.

 Draft documentation on version 3.6.0 is available at
 http://www.sqlite.org/draft/doc/index.html
 .  Please pay particular attention to:

 http://www.sqlite.org/draft/doc/35to36.html

 If you sees any problems with the upcoming release, or finds omissions
 or errors or ambiguities in the documentation, now would be a very
 good time to speak up.  Thank you for your attention.

 D. Richard Hipp
 [EMAIL PROTECTED]



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

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


Re: [sqlite] sqlite3.lib for ARMV4T processor

2008-06-12 Thread Virgilio Fornazin
IF you are using SQLite with eVC, you must enabled function level linking,
because
ARM linkers had a bug before eVC SP4 that generated corrupt image files.

On Thu, Jun 12, 2008 at 9:39 AM, sqlite [EMAIL PROTECTED] wrote:


 Dear All,

  We are using SQLite for our application development which would be
 deployed in a pocket pc of type DTX 10 processor ARMV4T.Also we have
 generated the lib file specific for ARM processor using the LIB.exe with
 the
 parameters DEF:sqlite3.def MACHINE:ARM and the sqlite3.lib and sqlite3.dll
 files are generated. When we compiled the application with the sqlite
 functions like sqlite3_open() the application gets compiled and the exe
 also
 gets generated with out any errors. But when we run the application in the
 DTX10 device it throws an error Application is not a valid WINCE
 application but when we remove the function call sqlite3_open() from the
 application and run it in the device it is running without any errors. Have
 we generated the sqlite3.lib and sqlite3.dll files correctly? because we
 have mentioned the machine name as ARM and using the sqlite3.lib file for
 ARMV4T processor, is it correct? if not how to generate the sqlite3.lib
 file
 for the processor ARMV4T, kindly help us in this regard. Or if possible
 provide us the sqlite3.lib file meant for ARMV4T processor.

 Thanks
 Kartthikeyan
 --
 View this message in context:
 http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17798977.html
 Sent from the SQLite mailing list archive at Nabble.com.

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

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


Re: [sqlite] multiple writers for in-memory datastore

2008-04-19 Thread Virgilio Fornazin
what about creating a VFS for such task ? Can be accomplished in many ways,
using heap memory, shared memory... not so easy to do, but not much
complicated too... locking can be provided by multiple-readers
single-writers locks strategies, etc...

On Sat, Apr 19, 2008 at 2:29 PM, James Gregurich [EMAIL PROTECTED]
wrote:


 oh good! That isn't the version that ships with Leopard, but I can
 live with deploying my own version as part of my app.

 Will l get the writer parallelism I'm after as long as each thread
 writes exclusively into its own attached db?


 in other wordstwo bulk insert operations going on simultaneously
 on the same connection but each insert operation going into a
 different attached in-memory db.


 On Apr 19, 2008, at 9:20 AM, Dan wrote:

 
  On Apr 19, 2008, at 6:06 AM, James Gregurich wrote:
 
 
  I'll ask this question. The answer is probably no, but I'll ask it
  for the sake of completeness.
 
 
  Suppose I created an in-memory db. I use the attach command to
  associate an additional in-memory db. Suppose I assign the main db to
  thread 1 and the associated db to thread 2. Can I share the
  connection
  across the 2 threads if each thread works exclusively in its own db?
 
  I am aware that the connection is generally not threadsafe, but will
  it work if the two threads don't operate on the same db at the same
  time?
 
  As of 3.5, sqlite connections are threadsafe by default. With
  earlier versions, this trick will not work.
 
  Dan.
 
 
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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

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


Re: [sqlite] Date arithmetic question

2008-01-17 Thread Virgilio Fornazin
DATEDIFF should compute the difference by arithmetic subtracting M/Y in
month case, if I'm not wrong

ex:

DateDiff (month, 1-1-2007, 3-30-2007) will return 2

Its that right ?

A good reference for trying implementing it should be:

http://www.sqlteam.com/article/datediff-function-demystified


On Jan 17, 2008 6:12 PM, [EMAIL PROTECTED] wrote:

 Fowler, Jeff [EMAIL PROTECTED] wrote:
  Yes - I've looked over the current date functions. I would propose a
  single function addition that's hugely valuable in the business world.
  SQL Server has a function called datediff for date arithmetic. It
  accepts three parameters. The first indicates the unit of scale (years,
  months, weeks, days, etc. - I think it even goes into milliseconds!).
  The next two parameters are the dates to compute the difference between.
  It returns an integer.
 

 Fair enough, and simple enough to do for weeks, days, and smaller
 intervals.  But what algorithm do I use to compute the number of
 months difference?  Or years?  Is there a standard for such a
 thing?  Anybody know?

 --
 D. Richard Hipp [EMAIL PROTECTED]



 -
 To unsubscribe, send email to [EMAIL PROTECTED]

 -




Re: [sqlite] Proposed sqlite3_initialize() interface

2007-10-30 Thread Virgilio Fornazin
I always create and XXX_Initialize() (and also XXX_Finalize() for resources
cleanup) in
all libraries I created, because:

- You can perform initializations that cannot be done at compile time;
- You can create your internal structures in the required order (C++ has the

problem of initialization / finalization order of static objects, that could
be a pain
in some cases), independing on compiler / link order of your object files;

Putting a simple call to a sqlite3_initialize() in a program costs near to
nothing in my
point of view, and could make things simpler for sqlite3 library.

On Oct 30, 2007 12:18 PM, [EMAIL PROTECTED] wrote:

 As currently implemented, SQLite3 requires no initialization.
 You just start calling SQLite3 interfaces and they work.  We
 can pull off this trick on Unix because pthread mutexes can
 be initialized statically at compile-time.

  static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

 On win32, we have to initialize mutexes at run-time, but this
 can be done within a contrived mutex that we build off of
 a static integer using InterlockedIncrement().  And mutex
 initialization apparently never fails on win32, so we do not
 have to worry with reporting errors that occur during
 mutex initialization.

 But there are other operating systems using SQLite that do
 not work this way.  They need a way to initialize mutexes
 (and possibly other objects such as malloc) prior to running
 any SQLite interface.  And the initialization needs to be able
 to fail and return an error code.

 To accomodate this need, we are considering an incompatible
 API change to SQLite.  We are thinking of requiring that an
 application invoke:

int sqlite3_initialize(...);

 prior to using any other SQLite interface.  (The parameters to
 sqlite3_initialize() are not yet designed.)  It will be an error
 to use any other SQLite interface without first invoking
 sqlite3_initialize() exactly one.  It is also an error to
 invoke sqlite3_initialize() more than once.

 Existing applications that use SQLite would have to be modified
 to invoke sqlite3_initialize().  Presumably this would happen
 very early in main(), before any threads were created.  No other
 code changes would be required.

 This is still just an idea.  If you think that adding a new
 required sqlite3_initialize() interface would cause serious
 hardship for your use of SQLite, please speak up now.

 --
 D. Richard Hipp [EMAIL PROTECTED]



 -
 To unsubscribe, send email to [EMAIL PROTECTED]

 -




Re: [sqlite] how to get file handle from sqlite3 object?

2007-10-11 Thread Virgilio Fornazin
I'm thinking about this.. to get a 'exact' copy of a sqlite database we
should implement a new public API:

sqlite3 * sqlite3_clonedb(sqlite3 * db, const char * szOutput);
sqlite3 * sqlite3_clonedb16(sqlite3 * db, const void * szOutput); // utf-16
version

this api can do the real file copy without exposing any characteristics of
the sqlite3 database (this db could be copied from / to :memory: databases
on this way) and also deal with internal VFS driver intrinsics, such as
sector size, and etc.



On 10/11/07, Joe Wilson [EMAIL PROTECTED] wrote:

   sqlite3OsFileHandle no longer exists.

  Can you tell me the first sqlite3 version to include this change?

 I'm guessing that it's 3.5.0 when most of the code was revised.




 
 Yahoo! oneSearch: Finally, mobile search
 that gives answers, not web links.
 http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC


 -
 To unsubscribe, send email to [EMAIL PROTECTED]

 -




Re: [sqlite] Compiling amalgamation with G++

2007-09-18 Thread Virgilio Fornazin
-ldl -lpthread

(at least in my last builds)

On 9/18/07, Olaf Beckman Lapré [EMAIL PROTECTED] wrote:

 I'm trying to compile the amalgamation on Xubuntu Linux with G++ but I'm
 getting linking errors: several about pthread and others about dlopen() etc.

 Is there anything I need to add (libraries, includes, defines) to get it
 to compile?

 Kind regards, Olaf