Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread Doug Currie
On Jul 24, 2009, at 8:44 AM, D. Richard Hipp wrote:

> SQLite database files are cross-platform.  All you have to do is copy
> the file to the new machine.  There is no separate "external format".
> The same database file format work on all platforms.

Just make sure that if you are moving to a new platform, that the data  
formats match those expected by SQLite. This is especially important  
for platforms with weird floating point formats. For example, on ARM  
platforms there are a couple floating point formats, and the  
SQLITE_MIXED_ENDIAN_64BIT_FLOAT compile switch helps accommodate them.

SQLite provides support to get this right:

** Developers using SQLite on an ARM7 should compile and run their
** application using -DSQLITE_DEBUG=1 at least once.  With DEBUG
** enabled, some asserts below will ensure that the byte order of
** floating point values is correct.

e

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


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread Griggs, Donald
 Re: "I can't see how you get to that page."

I found the link from page:
http://www.sqlite.org/features.html
And perhaps it's linked from others as well.


Re: "I would expect to reorganise the physical database on a regular
basis..."

Once again, I'd look at the VACUUM command, though you may find you
don't really need to run it very often.
http://www.sqlite.org/lang_vacuum.html

You may also be interested in the ANALYZE command, which can provide
hints to sqlite's query optimizer.
http://www.sqlite.org/lang_analyze.html
Once you're up and running with your database app, running analyze just
once may be enough.

You might want to do some experiments to see if running either of these
frequently has a measurable benefit to your application.


Hope this helps,
   Donald
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread Rich Shepard
On Fri, 24 Jul 2009, CityDev wrote:

> I'm only familiar with DB2, Access Jet and Focus. In each case I would
> expect to reorganise the physical database on a regular basis - maybe
> daily or weekly. What's the best way of doing that with SQLite?

   Vacuum.

Rich

-- 
Richard B. Shepard, Ph.D.   |  IntegrityCredibility
Applied Ecosystem Services, Inc.|Innovation
 Voice: 503-667-4517  Fax: 503-667-8863
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread CityDev

Thanks Donald. I can't see how you get to that page off the documentation
menu but now I can go direct.

I'm only familiar with DB2, Access Jet and Focus. In each case I would
expect to reorganise the physical database on a regular basis - maybe daily
or weekly. What's the best way of doing that with SQLite?
-- 
View this message in context: 
http://www.nabble.com/SQLite%3A-Porting-to-another-Operating-system.-tp24640206p24648140.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


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread Simon Slavin

On 24 Jul 2009, at 2:09pm, CityDev wrote:

>  All you have to do is copy
>
> That's handy - I didn't realise that. However I suggest it's good  
> practice
> to dump and reload in these kinds of situations. I don't yet know  
> how SQLite
> works but I suspect a reload will get the physical data into a  
> better shape
> and clear out deleted items etc. Do you know where's there's  
> documentation
> on this?

There's really only one good candidate for something like this:  
dumping a database as a set of SQL commands.  If you want to convert  
'database --> commands' or 'commands --> database', and you don't want  
to write your own software to do it, you can use the sqlite3 command- 
line tool, either in interactive mode or batch mode.  Take a look at  
the '.dump' and '.read' commands in



Of course, an entire database as SQL commands can be a really big file  
but gzip/ZIPping it works wonders because there's a great deal of  
repetition in SQL commands.

But as for your need for such things ... probably not.  Unless you  
routinely create 1000 records then delete 900 of them, you're not  
saving anything by a big export/import process.  What you are doing is  
giving yourself a backup of your database which can be read by a human  
and processed by computers which are not running SQLite.  If you  
suffer a total failure of your technology this can be extremely useful  
and give you many options for restoration.  It's how I keep my SQL  
backups.  But if all goes to plan you'll never use it.

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


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread Griggs, Donald
Hi, CityDev,

Regarding:
  All you have to do is copy  

That's handy - I didn't realise that. However I suggest it's good
practice to dump and reload in these kinds of situations. I don't yet
know how SQLite works but I suspect a reload will get the physical data
into a better shape and clear out deleted items etc. Do you know where's
there's documentation on this?

--

Dr. Hipp is the originator of sqlite, so it's hard to find advice more
authoritative than his.   For removing deleted items (which would be
reused as needed anyway), you may want to look at the VACUUM command --
it also rebuilds the db structures. 

If you still need an external ascii dump, there is a
command-line-interface utility documented at:
   http://www.sqlite.org/sqlite.html
The ".dump" command gives you sql which can rebuild a database (via the
".read" command). 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread chandan
D. Richard Hipp wrote:
> On Jul 24, 2009, at 8:37 AM, CityDev wrote:
>
>   
>> I'm new to SQLite. I would assume you would dump the tables to an  
>> external
>> format and then load them into the new database. I can't however see  
>> where
>> the documentation is for this kind of database management function.  
>> Anyone
>> know where I should look, or do you have to download the SQLite3  
>> application
>> to see it?
>> 
>
>
> SQLite database files are cross-platform.  All you have to do is copy  
> the file to the new machine.  There is no separate "external format".   
> The same database file format work on all platforms.
>
> I think the OP was asking what changes need to be made to SQLite in  
> order to get it to compile and run on a platform other than the ones  
> that are supported out of the box (unix, win32, os/2).  Here is a  
> quick summary:
>
> (1) Write a VFS implementation for the target platform.  Use the  
> os_unix.c, os_win.c, and os_os2.c files as a guide, if you like.  See  
> also the documentation on the sqlite3_vfs object.
>
> (2) Compile the amalgamation using -DSQLITE_OS_OTHER.  This disables  
> the built-in OS interface layer.
>
> (3) Before using SQLite in your application, call  
> sqlite3_vfs_register() to install your alternative OS driver.
>
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
Thanks for the reply. :-)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread CityDev

  All you have to do is copy  

That's handy - I didn't realise that. However I suggest it's good practice
to dump and reload in these kinds of situations. I don't yet know how SQLite
works but I suspect a reload will get the physical data into a better shape
and clear out deleted items etc. Do you know where's there's documentation
on this?

-- 
View this message in context: 
http://www.nabble.com/SQLite%3A-Porting-to-another-Operating-system.-tp24640206p24644244.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


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread D. Richard Hipp

On Jul 24, 2009, at 8:37 AM, CityDev wrote:

>
> I'm new to SQLite. I would assume you would dump the tables to an  
> external
> format and then load them into the new database. I can't however see  
> where
> the documentation is for this kind of database management function.  
> Anyone
> know where I should look, or do you have to download the SQLite3  
> application
> to see it?


SQLite database files are cross-platform.  All you have to do is copy  
the file to the new machine.  There is no separate "external format".   
The same database file format work on all platforms.

I think the OP was asking what changes need to be made to SQLite in  
order to get it to compile and run on a platform other than the ones  
that are supported out of the box (unix, win32, os/2).  Here is a  
quick summary:

(1) Write a VFS implementation for the target platform.  Use the  
os_unix.c, os_win.c, and os_os2.c files as a guide, if you like.  See  
also the documentation on the sqlite3_vfs object.

(2) Compile the amalgamation using -DSQLITE_OS_OTHER.  This disables  
the built-in OS interface layer.

(3) Before using SQLite in your application, call  
sqlite3_vfs_register() to install your alternative OS driver.


D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread CityDev

I'm new to SQLite. I would assume you would dump the tables to an external
format and then load them into the new database. I can't however see where
the documentation is for this kind of database management function. Anyone
know where I should look, or do you have to download the SQLite3 application
to see it?
-- 
View this message in context: 
http://www.nabble.com/SQLite%3A-Porting-to-another-Operating-system.-tp24640206p24643787.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