Skip to content

Instantly share code, notes, and snippets.

@hryk
Created April 8, 2013 15:03
Show Gist options
  • Save hryk/5337472 to your computer and use it in GitHub Desktop.
Save hryk/5337472 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'sequel'
DB = Sequel.connect('jdbc:sqlite:memory:')
DB.create_table :items do
primary_key :id
String :string_attribute
Boolean :boolean_attribute
end
DB[:items].insert(string_attribute: 'Foo',
boolean_attribute: false)
item = DB[:items].first
puts item[:boolean_attribute].class
puts item[:boolean_attribute].inspect
# => String
# => "f"
#
# with JRuby 1.7.2
@hryk
Copy link
Author

hryk commented Apr 9, 2013

According to this spec of sequel, sequel's jdbc adapter for sqlite3 does not support generic boolean type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment