A Quick Guide to SQLite and Ruby

  • Thread starter why the lucky stiff
  • Start date
W

why the lucky stiff

-Talkers:

I've been truly impressed by SQLite, a small database with support for much of
SQL-92. This is a swift, ACIDic, customizable database that could be useful
to a great many Ruby developers.

Looking around RAA, I found a few extensions for using SQLite, but very little
documentation. Distilling the SQLite documentation can be a lot to take in
at once, so I've started to collect my own experience into a quick guide for
the uninitiated.

http://whytheluckystiff.net/articles/2003/07/02/aQuickGuideToSQLite

I will continue to add to this page as I experiment. Thank you.

_why
 
J

james_b

why said:
-Talkers:

I've been truly impressed by SQLite, a small database with support for much of
SQL-92. This is a swift, ACIDic, customizable database that could be useful
to a great many Ruby developers.

Looks like version 5 of of PHP includes SQLite.
http://news.php.net/article.php?group=php.announce&article=40

Something to consider for Ruby?
Looking around RAA, I found a few extensions for using SQLite, but very little
documentation. Distilling the SQLite documentation can be a lot to take in
at once, so I've started to collect my own experience into a quick guide for
the uninitiated.

http://whytheluckystiff.net/articles/2003/07/02/aQuickGuideToSQLite

I will continue to add to this page as I experiment. Thank you.

No, thank *you*.


_james
 
W

why the lucky stiff

Richard said:
But the page says "No Story Found"

Rich, what browser are you in? I'm using a bit o' mod_rewrite, so I'm
thinking this has to do with the path the browser is sending.

_why
 
A

ahoward

-Talkers:

I've been truly impressed by SQLite, a small database with support for much of
SQL-92. This is a swift, ACIDic, customizable database that could be useful
to a great many Ruby developers.

Looking around RAA, I found a few extensions for using SQLite, but very little
documentation. Distilling the SQLite documentation can be a lot to take in
at once, so I've started to collect my own experience into a quick guide for
the uninitiated.

http://whytheluckystiff.net/articles/2003/07/02/aQuickGuideToSQLite

I will continue to add to this page as I experiment. Thank you.

very cool. i used the package a bit using one extension - i can't remember
which - and was getting alot of bizzare errors which would leave the ruby
object in an invalid state...

anyhow - this must certainly be the coolest embedable rdbms out there and
should be a good match for ruby. one thing i'll comment on though - the
speeds are not quite what i'd hoped (or claimed) - not bad though.


something like this (perhaps *just* like this) distributed with ruby would be
simply unreal IMHO... having web and database packages standard with a
language is a powerful combo, especially an embedded database like sqlite;
i've been using pstore, cgi, and cgi::session::pstore (my own package) for
most of my web work since it makes moving an app to another server a simple
matter of tar/un-tar. sqlite also would have this advantage.

one other note - i've successfully used sqlite from different machines on an
nfs mounted db file. pretty cool...

enough rambles.

-a
--
====================================
| Ara Howard
| NOAA Forecast Systems Laboratory
| Information and Technology Services
| Data Systems Group
| R/FST 325 Broadway
| Boulder, CO 80305-3328
| Email: (e-mail address removed)
| Phone: 303-497-7238
| Fax: 303-497-7259
| ~ > ruby -e 'p(%.\x2d\x29..intern)'
====================================
 
A

ahoward

Doesn't work for me, either, with either Safari 1.0 or IE 5.2.3 on Mac OS X.
It does work with Mozilla Firebird 0.6.

nor nutscrape 4.7x


at least, i simply get a white page with this as the source:

<!--

And then I realized, that I was the world.
But the world was not me.
Although, at the same time, I was the world.
But the world was not me.
But I was the world.
But the world was not me.
But I was the world.
But the world was not me.
But I was the world.
And after that I did not think anything anymore.

- Daniil Kharms
-->


-a
--
====================================
| Ara Howard
| NOAA Forecast Systems Laboratory
| Information and Technology Services
| Data Systems Group
| R/FST 325 Broadway
| Boulder, CO 80305-3328
| Email: (e-mail address removed)
| Phone: 303-497-7238
| Fax: 303-497-7259
| ~ > ruby -e 'p(%.\x2d\x29..intern)'
====================================
 
B

Brian Candler

I've been truly impressed by SQLite, a small database with support for much of
SQL-92. This is a swift, ACIDic, customizable database that could be useful
to a great many Ruby developers.

Biggest problem I have with ruby-dbi and Sqlite: if you set db['AutoCommit']
= false, which is actually the default, then ruby-dbi keeps a transaction
open at all times. That is, it issues "begin transaction" as soon as the
database is opened, and then after a "commit" it issues another "begin
transaction" immediately.

SQLite locks the entire database when a transaction is in progress, and
therefore the database can only ever be seen by a single connection /
thread / process.

$ cat x.rb
#!/usr/local/bin/ruby
require 'dbi'

a = DBI.connect('dbi:Sqlite:foobar')
b = DBI.connect('dbi:Sqlite:foobar')

$ ruby x.rb
/usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:567:in `Connect': database is locked(database is locked) (DBI::DatabaseError)
from /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:567:in `Connect'
from /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:367:in `Connect'
from x.rb:5

Unfortunately it seems that ruby-dbi's transaction support is broken (it has
a concept of 'commit' but not of 'begin') so it's hard to fix this without
major surgery to ruby-dbi itself.

Regards,

Brian.
 
J

Josef 'Jupp' Schugt

Saluton!

* Karl Lopes; 2003-07-03, 12:20 UTC:
unsubscribe

The mail header contains:

X-ML-Info: If you have a question, send e-mail with the body
"help" (without quotes) to the address (e-mail address removed);
help=<mailto:[email protected]?body=help>
List-Post: <mailto:[email protected]>
List-Owner: <mailto:[email protected]>
List-Help: <mailto:[email protected]?body=help>
List-Unsubscribe: <mailto:[email protected]?body=unsubscribe>

The problem is that many people do not know how or don't even have a
chance to access that header information. Wouldn't it be better to
append that information to the mail body?

That would reduce the probability of further such unsubscribe
messages.

Gis,

Josef 'Jupp' Schugt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top