SQLite3/Ruby 1.2.5 Released!

Posted: July 25th, 2009 | Author: FreedomCoder | Filed under: Open Source, Programming, SQL | Tags: , , | No Comments »

I just released an updated version of SQLite3/Ruby, officially to RubyForge!

Read the news here

This release includes binaries for Windows, but not any kind of binary, but fat ones!

That means that using either 1.8 or 1.9 versions of Ruby you will be able to access SQLite3/Ruby bindings and script your craziest applications!

This also solves the major PITA for gem update that lot of user experienced in the past.

Don’t forget to read a getting started guide here

Now is time to hunt down MySQL gem author and politely ask him integrate my patches ;)

(Via DEV_MEM.dump_to(:blog) – Multimedia systems blog.) Original Link: SQLite3/Ruby 1.2.5 Released!


Creando consultas ActiveRecord a partir de SQL

Posted: March 22nd, 2009 | Author: FreedomCoder | Filed under: ActiveRecord, Programming, SQL | Tags: , , , | Comments Off

Buscando la razón por la cual me falla un find_each dentro de un rake, me encontré con este sitio que sin dudas no deja de ser interesante. Suele pasar que tenemos en claro como construir una sentencia SQL pero no sabemos como hacerlo en ActiveRecord. Este pequeño script lo resuelve. Lo estuve probando y hay casos en los que no devuelve nada, como ser pasando rangos con BETWEEN, por ejemplo.


select * from members where first_name = 'Harold' and age = '34'
=> Members.find(:all, :conditions => {:age => "34", :first_name => "Harold"}

select * from members
=> Members.find(:all)

select * from members where first_name = 'Harold'
=> Members.find(:all, :conditions => {:first_name => "Harold"}

select * from members where first_name like '%Harold%'
=> Members.find(:all, :conditions => ["first_name like ?", '%Harold%'])

leer más

(Via Rodolinux – Rodolinux’s Playground.)Original Link: Creando consultas ActiveRecord a partir de SQL