Open solnic opened 13 years ago
require 'dm-core' require 'dm-migrations'
DataMapper::Logger.new($stdout, :debug) DataMapper.setup(:default, 'sqlite::memory:')
class Group include DataMapper::Resource
property :number, Serial property :groupname, String, :length => 40 end
DataMapper.auto_migrate!
require 'dm-aggregates'
Group.count
END
ruby-1.9.2-preview3 mungo:dm-snippets snusnu$ bundle exec ruby zem.rb ~ (0.000102) SELECT sqlite_version(*) ~ (0.000146) DROP TABLE IF EXISTS "groups" ~ (0.000014) PRAGMA table_info("groups") ~ (0.000319) CREATE TABLE "groups" ("number" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "groupname" VARCHAR(40)) ~ (0.000069) SELECT "number", "groupname" FROM "groups" ORDER BY "number"
Created by Martin DeMello - 2010-06-28 23:47:25 UTC
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1344
Pastie link: http://pastie.org/1022588
by Martin Gamsjaeger (snusnu)
require 'dm-core' require 'dm-migrations'
DataMapper::Logger.new($stdout, :debug) DataMapper.setup(:default, 'sqlite::memory:')
class Group include DataMapper::Resource
property :number, Serial property :groupname, String, :length => 40 end
DataMapper.auto_migrate!
require 'dm-aggregates'
Group.count
END
ruby-1.9.2-preview3 mungo:dm-snippets snusnu$ bundle exec ruby zem.rb ~ (0.000102) SELECT sqlite_version(*) ~ (0.000146) DROP TABLE IF EXISTS "groups" ~ (0.000014) PRAGMA table_info("groups") ~ (0.000319) CREATE TABLE "groups" ("number" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "groupname" VARCHAR(40)) ~ (0.000069) SELECT "number", "groupname" FROM "groups" ORDER BY "number"
Created by Martin DeMello - 2010-06-28 23:47:25 UTC
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1344