Search the web
Sign In
New User? Sign Up
metabase-dev · Metabase Development discussions list
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
SQLite Driver working with php5 extensions   Message List  
Reply | Forward Message #1131 of 1151 |
Re: [metabase-dev] Re: SQLite Driver working with php5 extensions

Hello,

on 10/31/2005 02:38 PM jonbouyw said the following:
> Yes I did run the conformance tests and it passes all of the tests
> including NULLS.

I haven't tried it yet. Does it skip any tests or performs all the 16
tests? I assume that at least auto-increment tests are skipped.


> I'm not clear on how the autoincrement works within Metabase at the
> moment, but as you know SQLite will treat a primary key field of the
> type INTEGER as an autoincrement field, I'm investigating how to
> incorporate in the Metabase context. I would appreciate any
> suggestions you have in this regard.

That is very similar to MySQL. You may want to take a look at its driver
class.

You need to make the Setup function tell it supports AutoIncrement and
PrimaryKeys. If you can omit the column of an auto-increment field and
the database automatically inserts the next key, also tell that it
supports OmitInsertKey.

You also need to adjust the GetIntegerFieldTypeDeclaration function to
make it declare auto-increment fields when it is the case.

You need to implement GetNextKey and GetInsertedKey to prepare and
retrieve auto-increment key values. See the documentation for more details.


> Also I'm looking into the manager class as I have some ALTER TABLE
> functions to emulate the ALTER TABLE functions that are lacking in
> SQLite which are implemented by recreating a new table with the
> alterations included an then re-writing the original database. This
> is slow but does provide full ALTER TABLE functionality. Again I'm
> investigating how to include this within the Metabase context.

MySQL implements table alterations that way but the necessary SQL is simple.

To implement a full blown AlterTable from scratch is tricky but many
people will appreciate your effort. Just try to implement one kind of
table alteration at a time playing with a test schema, and let me know
when you have questions.


> As well I expect to be able to produce a SQLite PDO driver which
> shouldn't be too dissimilar to the SQLite one already provided.

PDO may be more complicated. It is better to start from a generic base
PDO driver class, like there is for ODBC, but not for PDO right now.
Lets deal with one driver at a time.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html



Mon Oct 31, 2005 7:13 pm

mallemos
Offline Offline
Send Email Send Email

Forward
Message #1131 of 1151 |
Expand Messages Author Sort by Date

Manuel Hi I've been using metabase now for a few months I use it to develop small apps using sqlite. I have been working with this driver converted for the...
jonbouyw
Offline Send Email
Oct 29, 2005
2:23 am

Hello, ... Great! I was going to do this soon or later but I am glad you did it as saves me time. The original driver was developed for a PHP SQLite extension...
Manuel Lemos
mallemos
Offline Send Email
Oct 29, 2005
4:07 am

... Yes I did run the conformance tests and it passes all of the tests including NULLS. I'm not clear on how the autoincrement works within Metabase at the ...
jonbouyw
Offline Send Email
Oct 31, 2005
4:55 pm

Hello, ... I haven't tried it yet. Does it skip any tests or performs all the 16 tests? I assume that at least auto-increment tests are skipped. ... That is...
Manuel Lemos
mallemos
Offline Send Email
Oct 31, 2005
7:13 pm

... Do you have any tests for REPLACE? It should fail those as sqlite does not return the same affected row values as mysql .. ... You can specific...
Lukas Kahwe Smith
dybvandal
Online Now Send Email
Oct 31, 2005
10:26 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help