Re: [sqlite] Do source updates effect DB file compatiblity?

2005-03-18 Thread Ng Pheng Siong
On Fri, Mar 18, 2005 at 02:13:39PM -0800, Kiel W. wrote:
> As SQLite progresses and I update my source with new releases,
> recompile and deploy 

If your application works fine with the version that you've embedded, why
change? 

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com   -+- Transparent AES Encryption for SQLite


Re: [sqlite] thoughts on a web-based front end to sqlite3 db?

2005-03-11 Thread Ng Pheng Siong
On Fri, Mar 11, 2005 at 02:16:35PM -, Steve O'Hara wrote:
> I'd like England to win the World Cup...

I thought England did win the rugby World Cup the last time out?
Oh, you mean _football_!

;-)

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] thoughts on a web-based front end to sqlite3 db?

2005-03-07 Thread Ng Pheng Siong
On Mon, Mar 07, 2005 at 04:22:50PM -0500, Eli Burke wrote:
> Ease of learning is a plus as I need to get something basic up and 
> running fairly fast. I've heard good things about Python in that respect.
> Does anyone have alternative suggestions, or if you agree that Python Is 
> Good, would you suggest using APSW, pysqlite, or something else?

Python is not bad, and you only have APSW and pysqlite to choose from.

OTOH, the number of web frameworks in/for Python probably rivals the number
of available Linux distros...

http://www.python.org/moin/WebProgramming
http://www.python.org/moin/WebStack
    
HTH.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] authenticating user before allosw to use sql_lite?

2005-02-15 Thread Ng Pheng Siong
On Tue, Feb 15, 2005 at 08:21:10AM -0800, teoh wrote:
> hi , Is it possible to prompt user for username and
> password before allow to use database like in mysql?

An SQLite database is a single disk file. If you can grab the file, you can
use the 'sqlite' shell or your own SQLite API-using program to look at it.

If you use SQLite with PHP, say, you can use some external authentication
mechanism (backed by another SQLite database, even) to control access to
your SQLite database file. In this case, the 'user' accessing the SQLite
database(s) is the Apache server process in the typical mod_php situation.

My company (ahem, the company I work for) sells an encrypting version of
SQLite where the encryption key is derived from a passphrase. But there is
still no notion of 'user'.

HTH.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] Accesing database remotely

2005-01-31 Thread Ng Pheng Siong
On Mon, Jan 31, 2005 at 05:09:56PM -0500, Stephen C. Gilardi wrote:
> You may get it to work, but using an sqlite database file on a network 
> file system has been reported to be troublesome.  

FWIW I wrote a test program that wrote to a database file on a network
drive concurrently from several PCs. All PCs ran Win98. I tested with the
network drive being a Win98 share and Samba on FreeBSD (it was a
dual-boot). It worked _for_me_. YMMV.

> <http://www.sqlite.org/lockingv3.html> in a section entitled "How To 
> Corrupt Your Database Files":

I've also seen Google search results where "optimistic" or "opportunistic"
caching on Windows clients may cause data corruption, in the context of
other file-based database libraries.

Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] Detecting if the db has changed

2004-12-22 Thread Ng Pheng Siong
On Wed, Dec 22, 2004 at 06:53:15AM -0800, Roger Binns wrote:
> >If concurrent access is by instances of your program only, they can
> >rendezvous via a private table. 
> 
> Yes, but that involves modifying every single code path that could
> update any of the many tables I use to update the private table.

Are you using your Python binding? If yes, maybe you can make the "commit"
action invoke a callback which updates said private table. Every code path
that writes to tables does so within a transaction, no? 

Of course, if your code commits by issuing an SQL statement in place
instead of calling a Python function that wraps said SQL statement, then
you still have to touch every code path.

Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] Detecting if the db has changed

2004-12-22 Thread Ng Pheng Siong
On Tue, Dec 21, 2004 at 07:58:46PM -0800, Roger Binns wrote:
> Richard already answered.  There is no mystery about who else is writing to
> the db - it will be another instance of my program.

If concurrent access is by instances of your program only, they can
rendezvous via a private table. 

Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] example for TCP connection to sqlite database.

2004-12-09 Thread Ng Pheng Siong
On Thu, Dec 09, 2004 at 10:29:29PM -, Richard Boyd wrote:
> I need a simple way to connect to an sqlite database remotely using tcp
> (over IP). I've had a look at some offerings on the web such as sql relay
> (http://sqlrelay.sourceforge.net/). This is very comprehensive but seems to
> be a bit too sophisticated for my application and seems to require a fair
> amount of setup. I was wondering if anyone had any pointers for a simple
> client server that I could use to request data from databases remotely.

Dunno about simple, since I've not looked at it, but the wiki

http://www.sqlite.org/cvstrac/wiki?p=ClientServer

points to here:

http://www.it77.de/sqlite/sqlite.htm

On the same wiki page there is discussion about the TDS protocol. Recently,
I've also come across something called DRDA - "distributed relational
database architecture".

HTH.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] PySQLcrypt

2004-12-03 Thread Ng Pheng Siong
On Fri, Dec 03, 2004 at 09:56:42PM +0800, Ng Pheng Siong wrote:
> PySQLcrypt is an enhanced version of PySQLite that uses SQLcrypt, which
> itself enhances SQLite version 3 with transparent AES encryption.

I'm apologise for following up to myself, but I forgot to mention that I've
posted a blog entry with more details:

  http://sandbox.rulemaker.net/ngps/169

Thanks. Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


Re: [sqlite] [ANN] SQLcrypt 1.0

2004-11-25 Thread Ng Pheng Siong
On Mon, Nov 22, 2004 at 09:24:36AM +1100, Dennis Volodomanov wrote:
> Is anyone using the mentioned library? Is it stable and fast?

(First one didn't get thru. Trying again...)

Hi,

I suggest you download and test the trial version, which works just like
the retail version, apart from (a) being limited to a passphrase of exactly
8 bytes, and (b) have the passphrase stored in the clear in the first 8
bytes of the database file.

Check out this script that does timing tests for SQLcrypt, SQLite v3, MySQL
and PostgreSQL. The numbers posted on the SQLcrypt website are based on my
puny test machine. I'd be interested to see your numbers.

  http://www.sqlcrypt.com/speedtest-sqlcrypt.tcl

Just comment out the MySQL or PostgreSQL tests if you don't have them. Also
see this page for discussions about the timing tests and the use of crypto.

  http://www.sqlcrypt.com/versus.html

> Are there any other similar products for SQLite v3?

drh has a source-code add-in. His uses RC4; SQLcrypt uses AES.  His is
available for both SQLite v2 and v3; SQLcrypt is SQLite v3 only.

HTH. Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption


[sqlite] [ANN] SQLcrypt 1.0

2004-11-12 Thread Ng Pheng Siong
Hi all,

I'm pleased to announce the release of SQLcrypt.

http://www.sqlcrypt.com

SQLcrypt is SQLite 3 + transparent AES encryption. Try before you buy.
Please take a look.

Thanks. Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com   -+- Transparent AES Encryption For SQLite


Re: [sqlite] Saving database

2004-11-04 Thread Ng Pheng Siong
On Thu, Nov 04, 2004 at 10:18:12AM +0200, [EMAIL PROTECTED] wrote:
>   I've just started using Sqlite and still haven't figured out how to
>   save the database to the disk. I can create a database and insert any
>   data I want and select data from the table.  But as soon as I leave the
>   program all is gone.

If you're using the "sqlite3" command line shell, supply the database
filename when you start it:

  $ sqlite3 test.db
  SQLite version 3.0.8
  Enter ".help" for instructions
  sqlite> create table a (ak int, av int);
  sqlite> insert into a values (1,1);
  sqlite> ^D  
  $ ls -l test.db
  -rw-r--r--  1 ngps  ngps  2048 Nov  4 16:22 test.db

If you're using the C API, the first parameter to sqlite3_open() is the
filename.

HTH.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com   -+- AES Encryption for SQLite


Re: [sqlite] Crypt the database file

2004-11-02 Thread Ng Pheng Siong
On Tue, Nov 02, 2004 at 01:58:42PM +0100, Didier BRETIN wrote:
> I'm new to SQLite, and I try to know if it is possible to crypt de 
> database file used by
> SQLite. I try to find some documentation on this but I found nothing :(.

http://www.sqlcrypt.com

Currently in beta testing. Signups are still available.

Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
http://www.sqlcrypt.com   -+- AES Encryption for SQLite


Re: [sqlite] Warnings during compilation

2004-10-24 Thread Ng Pheng Siong
On Sun, Oct 24, 2004 at 08:17:52AM -0700, Will Leshner wrote:
> I'm assuming that in practice it is ok, but it does make some people
> nervous. It might be good to explicitly cast the results of
> floating-point math back to ints to make the compiler happy.

So if people cast to make the compiler happy then people won't be nervous?
;-)

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 
http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog


Re: [sqlite] Wich compiler to use in Windows

2004-10-20 Thread Ng Pheng Siong
On Wed, Oct 20, 2004 at 10:41:25AM -0200, Rubens Jr. wrote:
> Wich compiler do you recomend to use to compile sqlite3.0.8 in Windows ?

I use VC++ 6.0. 

Unpack the prepared source package, create a blank DLL project, drop all
the .c files except shell.c and tclsqlite.c, all the .h files and the .def
file into it, and build. It should give you ~124 warnings about __Int64 and
sqlite.dll.

Then create another blank Win32 console application project, add shell.c
and the sqlite.lib file built from the previous step, build it and you
should get an sqlite.exe linked against sqlite.dll.

I've also built it using msys, although strangely the generated sqlite3.exe
works on plain cmd.exe but not on msys's bash shell. I only wanted the
Lemon parser-generator anyway so I didn't investigate further.

HTH. Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 
http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog


Re: [sqlite] first DBD::SQLite for SQLite 3.x released

2004-07-22 Thread Ng Pheng Siong
On Thu, Jul 22, 2004 at 08:56:50PM -0700, Darren Duncan wrote:
> The simplest answer for both of these is to use DBD::SQLite 0.31 for 
> version 2 databases, and DBD::SQLite 1.0 for version 3 databases.  If 
> you mean, use them both simultaneously, then that's more complicated, 
> and I won't go into it now. -- Darren Duncan

I'd imagine keeping DBD::SQLite for v2 and creating DBD::SQLite3 for v3 is
the most straightforward approach.

Ditto for Python, Ruby, etc. etc.

Cheers.
-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://firewall.rulemaker.net -+- Cisco PIX & Netscreen Config Version Control 
http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog


Re: [sqlite] Simultaneosly using sqlite on windows

2004-05-17 Thread Ng Pheng Siong
On Tue, May 11, 2004 at 10:13:12PM +0200, Bronislav Klu?ka wrote:
> I've created application using SQLite as database (Windows application). The
> database is on remote server and application is accesing the database
> through file system (e.g. user connect server as P:\ disc and uses the path
> p:\databases\database.sdb). More users are accessing the database on the
> same time. But database became corrupted nad PRAGMA integrity_check returns
> some mistakes (pasted below). 

Hi,

Take a look at this page:

  http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html

It talks about disabling 'read caching' on clients and 'opportunistic
locking' on servers in the context of another shared-file database product.

If you do try the suggestions, please share your findings with the list.

Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
http://sandbox.rulemaker.net/ngps -+- ZServerSSL/Zope Windows Installers

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Saving BLOBs in Sqlite

2004-05-08 Thread Ng Pheng Siong
On Sat, May 08, 2004 at 03:32:28AM -0400, aducom wrote:
> You can use escape routines of your own but if other 
> app's will need the same database you might face compatibility 
> problems. It's been an isue to us rather a while now.

At the cost of boosting each blob's size by about 30%, base64 encoding of
the blobs raises no compatibility issues. 

Whether +30% is acceptable depends on the specific application, of course.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
http://sandbox.rulemaker.net/ngps -+- ZServerSSL/Zope Windows Installers

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Quick import

2004-03-31 Thread Ng Pheng Siong
On Mon, Mar 29, 2004 at 07:14:24PM +0200, Dembskey, E. (Evan) wrote:
> ID,Messier,Name,Type,Constellation,NGC,Magnitude,Size,RA,Dec,Season   
> 1,M001,Crab Nebula,Supernova remnant,Taurus,1952,8.4,5h 34.5m,22 01,Winter
   
I thought a size of 5h 34.5m is incredible, looked it up, and this number
turns out to be the Right Ascension. 

Your columns read "magnitude, size, RA, Dec" and your data is
"magnitude-value, RA-value, Dec-value". Size is missing.

Unless you typed it in by hand, it looks like your data is screwed up.

Cheers,

just-another-astronomy-buff-in-my-younger-days

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Magically turning a memory blob into an SQLite memory db?

2004-03-15 Thread Ng Pheng Siong
Hi,

How difficult is it to have a blob in memory which contains a binary image
of an SQLite disk database, from which to create an instance of an SQLite
memory database?

IOW, instead of creating an empty memory database and then populating it
with data, I want to go from a blob of memory to an application-specific
fully populated memory database.

For those who are familar with OpenSSL programming, I'm talking about
something similar to its BIO_s_mem, into which one can stuff a binary
string representing the serialisation of, say, an X.509 cert, and create (a
pointer to) an X509 struct out of it.

An idiomatic usage in OpenSSL's context is to keep a trusted CA cert or RSA
public key within the application binary, instead of in a disk file which
can be edited.

TIA. Cheers.

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]