logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: pysqlite design decisions: msg#00037

Subject: Re: pysqlite design decisions
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gerhard Häring wrote:
| By adding this:
|
| sqlite.enable_callback_tracebacks(1)
|
| You get more tracebacks printed to stderr when errors happen in callback
| functions (functions, aggregates, authorizers, etc.).

The point is that you shouldn't be printing tracebacks or swallowing the
exceptions in similar ways.  It should be handled by the calling code
like how exceptions normally work.

| There once was a good reason for doing it this way, but I forgot what
| exactly it was ;-) It had something to do with another error masking the
| original one in some cases, IIRC.

You just have to code carefully.  In APSW I use PyErr_Occurred() to see
if an exception has already occurred and if so, don't stomp all over it.

| They would sure be fun to use from Python, I'd really like to play with
| them. I even started implementing them in pysqlite, but it's a lot to wrap
| and will take a quite some time.

My code is complete and I am updating the test suite.  There are also a
lot of issues to deal with in SQLite itself as error behaviour is
undocumented and the code isn't much better.  For example if you return
an error code to the function that closes a virtual table, is the table
still live (ie keep objects around) or dead (ie destroy objects). I've
raised several tickets which drh hasn't responded to yet.

I also can't see any way to implement xFilter that doesn't hang on to
returned objects until the Connection object is closed.

| If we could integrate APSW and pysqlite in such a way that I could
| implement virtual tables on pysqlite connections, that would be really
| great. Basically what we'd need is some way that APSW could make sense
of a
| pysqlite connection object and use its sqlite3* handle. Do you think
that's
| feasible?

It is certain feasible but there are some issues.  Firstly we need to
agree on a method name that gets the handle (pointer) out of the object
in the first place.  That would also be useful to ctypes users.  The
Create/Connect method is passed the db handle as the first parameter.
Currently I save the connection object (PyObject) in the createmodule
implementation, and then use that in the callback code so you get OOR
(original object return).

You will also get SQLite/apsw semantics.  For example the function
implemented by the developer to return a field can only return one of
None, int, float, string or buffer.  There is no automatic type
mangling.  Also all exceptions thrown are apsw objects.

Lastly this is going to require SQLite 3.3.8 at a minimum, but there is
no way around that.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFeRr1mOOfHg372QQRAi3qAJ9oMBO97IKoUNi4/fVbZGUKEcM2HACfYgBx
pdAnm3NpSaQIQ7rv5PcA3nw=
=L3ed
-----END PGP SIGNATURE-----
_______________________________________________
pysqlite mailing list
pysqlite@xxxxxxxxxxxxxxx
http://lists.initd.org/mailman/listinfo/pysqlite
Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe