[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Initial release of amalgalite - v0.1.0

Jeremy Hinegardner

6/21/2008 11:49:00 PM

Amalgalite embeds the SQLite database engine in a ruby extension.

* http://www.copiousfreetime.org/projects/a...
* http://copiousfreetime.org/articles/2008/06/21/amalgalite-0-1-0-rel...

I would consider Amalgalite beta right now. It is fully usable; but it does not
contain all the features I want yet.

Give it a whirl and let me know what you think.

Current Functionality
--------------------

The normal stuff:

* open or create databases
* run SQL in single statements or in batches.
* use prepared statements with parameters
* access result sets by index or by column name
* transactions
* type conversion between database types and Ruby types

The fun/happy/cool stuff

* trace information
* profile information
* read only databases
* a type conversion protocol

Future plans
------------

* ActiveRecord driver
* DataMapper driver
* Sequel driver
* progress and authorizer callbacks
* 'amalgalite' command line tool similar to the 'sqlite3' command line tool
* utf-16 support
* blob support
* and more

{{ Release notes for Version 0.1.0 }}

* Initial public release

--
========================================================================
Jeremy Hinegardner jeremy@hinegardner.org


12 Answers

Joel VanderWerf

6/22/2008 12:16:00 AM

0

Jeremy Hinegardner wrote:
> Amalgalite embeds the SQLite database engine in a ruby extension.

Is that really better than linking with libsqlite?

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Jeremy Hinegardner

6/22/2008 1:10:00 AM

0

On Sun, Jun 22, 2008 at 09:15:46AM +0900, Joel VanderWerf wrote:
> Jeremy Hinegardner wrote:
>> Amalgalite embeds the SQLite database engine in a ruby extension.
>
> Is that really better than linking with libsqlite?

That depends on what you mean by "better" :-). If it is performane, I
have no idea, as I haven't run any performance tests yet.

For me, it is a few it is a few other reasons:

1) Windows support, because sqlite is embedded in the extension, I can
ship a Windows gem that doesn't require sqlite to be aleady
installed. I haven't built the windows gem yet, that should be
coming along in the next week or two.

2) SQLite "Professional Support Options". There are a couple of options
available from http://www.hwaci.com/sw/sqlite/prosu... that
I would like to be able to support. Namely the Encrypted Database
option. Having sqlite3.c embedded in the extension allows someone
who purchases one of those options to just drop the source code into
the gem and rebuild.

3) Feature control. I'm utilizing compliation dependent API calls.
Right now I'm utilizing the sqlite3_column_XXXX_name calls to get
column meta data for a result set. These API calls are only exposed
when SQLITE_ENABLE_COLUMN_METADATA=1 during compliation.

Also, eventually I'm going to expose two SQLite extensions, full text
search and R-trees. I'm sure everyone knows what full text search is
for, and the R-tree extension allows for extremely fast spatial
searching, i.e. latitude, longitude.

Thoughts, comments anyone? Do those sound like things you might use?

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jeremy@hinegardner.org


Joel VanderWerf

6/22/2008 1:46:00 AM

0

Jeremy Hinegardner wrote:
> Also, eventually I'm going to expose two SQLite extensions, full text
> search and R-trees. I'm sure everyone knows what full text search is
> for, and the R-tree extension allows for extremely fast spatial
> searching, i.e. latitude, longitude.

You mean like postgis, but in a sqlite sized package? That would be
very, very cool. I didn't know sqlite even had such an extension.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Jeremy Hinegardner

6/22/2008 1:54:00 AM

0

On Sun, Jun 22, 2008 at 10:46:28AM +0900, Joel VanderWerf wrote:
> Jeremy Hinegardner wrote:
>> Also, eventually I'm going to expose two SQLite extensions, full text
>> search and R-trees. I'm sure everyone knows what full text search is
>> for, and the R-tree extension allows for extremely fast spatial
>> searching, i.e. latitude, longitude.
>
> You mean like postgis, but in a sqlite sized package? That would be very,
> very cool. I didn't know sqlite even had such an extension.

Yup, its in the source tree but not part of the released version of
SQLite yet.

http://www.sqlite.org/cvstrac/dir?d=sqlite%2Fe...

I'm guessing it'll be in the next official release.

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jeremy@hinegardner.org


unbewusst.sein

6/24/2008 11:31:00 AM

0

Jeremy Hinegardner <jeremy@hinegardner.org> wrote:

> Amalgalite embeds the SQLite database engine in a ruby extension.
>
> * http://www.copiousfreetime.org/projects/a...
> * http://copiousfreetime.org...
2008/06/21/amalgalite-0-1-0-released.html

I've downloaded the gem, however install failed :
~/gems%> sudo gem install -l amalgalite
Password:
ERROR: Error installing amalgalite:
amalgalite requires configuration (>= 0.0.5)

if i try to install configuration, i get :
~/src/ruby/rubygems-1.2.0%> sudo gem install -r configuration
Password:
Bulk updating Gem source index for: http://gems.ruby...
ERROR: could not find configuration locally or in a repository

are u using the latest rubygems vesion ?

i'm running MacOS X 10.4.11
$> ruby --version
ruby 1.8.6 (2007-09-24 patchlevel 111) [powerpc-darwin8.11.0]
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.1.0 (1.1.0)
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111)
[powerpc-darwin8.11.0]
- INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/local/bin/ruby
- RUBYGEMS PLATFORMS:
- ruby
- powerpc-darwin-8
- GEM PATHS:
- /opt/local/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rub...

--
Une Bévue

ara.t.howard

6/24/2008 2:37:00 PM

0


On Jun 24, 2008, at 5:33 AM, Une B=E9vue wrote:

> Jeremy Hinegardner <jeremy@hinegardner.org> wrote:
>
>> Amalgalite embeds the SQLite database engine in a ruby extension.
>>
>> * http://www.copiousfreetime.org/projects/a...
>> * http://copiousfreetime.org...
> 2008/06/21/amalgalite-0-1-0-released.html
>
> I've downloaded the gem, however install failed :
> ~/gems%> sudo gem install -l amalgalite
> Password:
> ERROR: Error installing amalgalite:
> amalgalite requires configuration (>=3D 0.0.5)

cfp:~ > sudo gem install configuration
Bulk updating Gem source index for: http://gems.rub...
Successfully installed configuration-0.0.5
1 gem installed


it's on http://codefor... or =
http://rubyforge.org/projects/codefo...
if you just want to grab the gem - no idea what's up with you gem =20
command ;-(

a @ http://codefor.../
--
we can deny everything, except that we have the possibility of being =20
better. simply reflect on that.
h.h. the 14th dalai lama




unbewusst.sein

6/24/2008 3:41:00 PM

0

ara.t.howard <ara.t.howard@gmail.com> wrote:

> cfp:~ > sudo gem install configuration
> Bulk updating Gem source index for: http://gems.rub...
> Successfully installed configuration-0.0.5
> 1 gem installed

may be u aren't running Mac OS X 10.4.11 ??? :[

i've heard, i don't remember where and when, rubygems has probs with
remote install on mac os x 10.4.11.

however, in the meantime i did install sproutcore (from Apple) without
any prob...

notice i'm still unable to upgrade rubygems to 1.2...
>
> it's on http://codefor... or
> http://rubyforge.org/projects/cod...
> if you just want to grab the gem - no idea what's up with you gem
> command ;-(
>
> a @ http://codefor.../

right now i get trouble with mkrf )) :
~/gems%> sudo gem install -l configuration
Password:
Successfully installed configuration-0.0.5
1 gem installed

~/gems%> sudo gem install -l amalgalite
Building native extensions. This could take a while...
ERROR: Error installing amalgalite:
ERROR: Failed to build gem native extension.

/opt/local/bin/ruby mkrf_conf.rb install -l amalgalite
/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- mkrf (LoadError)
from
/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from mkrf_conf.rb:2


Gem files will remain installed in
/opt/local/lib/ruby/gems/1.8/gems/amalgalite-0.1.0 for inspection.
Results logged to
/opt/local/lib/ruby/gems/1.8/gems/amalgalite-0.1.0/ext/gem_make.out
~/gems%>

anyway, thanks, i got "configuration" !
--
Une Bévue

unbewusst.sein

6/24/2008 6:08:00 PM

0

Une Bévue <unbewusst.sein@weltanschauung.com.invalid> wrote:

just to say, finally i get it (ie. amalgalite), after mkrf update.

--
Une Bévue

Jeremy Hinegardner

6/26/2008 4:38:00 AM

0

On Wed, Jun 25, 2008 at 03:08:02AM +0900, Une B?vue wrote:
> Une B?vue <unbewusst.sein@weltanschauung.com.invalid> wrote:
>
> just to say, finally i get it (ie. amalgalite), after mkrf update.

That would be a bug on my part in amalgalite, thanks for fiding it.
I forgot to put a gem dependency on mkrf. Its fixed in the repository.

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jeremy@hinegardner.org


unbewusst.sein

6/26/2008 6:24:00 AM

0

Jeremy Hinegardner <jeremy@hinegardner.org> wrote:

> That would be a bug on my part in amalgalite, thanks for fiding it.
> I forgot to put a gem dependency on mkrf. Its fixed in the repository.

fine !

i did a first try reading a database created with PHP ;-)

no prob.

i've also listed the tables in this db using :
db.execute( "SELECT name FROM sqlite_master WHERE type='table' ORDER BY
name;" )

no prob too.

but, for the time being, i'm unable to find a way to list the columns
name within a given table...

are those info written into "sqlite_master" too ?
--
Une Bévue