Last active
December 22, 2015 06:29
-
-
Save lutter/6431747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
remote: http://torquebox.org/rubygems/ | |
specs: | |
blankslate (2.1.2.4) | |
diff-lcs (1.2.4) | |
edn (1.0.0) | |
parslet (~> 1.4.0) | |
fabrication (2.7.2) | |
faker (1.2.0) | |
i18n (~> 0.5) | |
i18n (0.6.5) | |
jdbc-postgres (9.2.1002.1) | |
json-schema (2.1.3) | |
kramdown (1.1.0) | |
mime-types (1.24) | |
multi_json (1.7.9) | |
parslet (1.4.0) | |
blankslate (~> 2.0) | |
rack (1.5.2) | |
rack-protection (1.5.0) | |
rack | |
rack-test (0.6.2) | |
rack (>= 1.0) | |
rake (10.1.0) | |
rest-client (1.6.7) | |
mime-types (>= 1.16) | |
rspec (2.13.0) | |
rspec-core (~> 2.13.0) | |
rspec-expectations (~> 2.13.0) | |
rspec-mocks (~> 2.13.0) | |
rspec-core (2.13.1) | |
rspec-expectations (2.13.0) | |
diff-lcs (>= 1.1.3, < 2.0) | |
rspec-mocks (2.13.1) | |
sequel (4.2.0) | |
simplecov (0.7.1) | |
multi_json (~> 1.0) | |
simplecov-html (~> 0.7.1) | |
simplecov-html (0.7.1) | |
sinatra (1.4.3) | |
rack (~> 1.4) | |
rack-protection (~> 1.4) | |
tilt (~> 1.3, >= 1.3.4) | |
terminal-table (1.4.5) | |
thor (0.18.1) | |
tilt (1.4.1) | |
torquebox (3.0.0) | |
thor (>= 0.14.6) | |
torquebox-cache (= 3.0.0) | |
torquebox-configure (= 3.0.0) | |
torquebox-core (= 3.0.0) | |
torquebox-messaging (= 3.0.0) | |
torquebox-naming (= 3.0.0) | |
torquebox-rake-support (= 3.0.0) | |
torquebox-security (= 3.0.0) | |
torquebox-stomp (= 3.0.0) | |
torquebox-transactions (= 3.0.0) | |
torquebox-web (= 3.0.0) | |
torquebox-cache (3.0.0-java) | |
torquebox-core (= 3.0.0) | |
torquebox-transactions (= 3.0.0) | |
torquebox-configure (3.0.0-java) | |
blankslate (= 2.1.2.4) | |
torquebox-core (3.0.0-java) | |
edn (= 1.0.0) | |
torquebox-messaging (3.0.0-java) | |
torquebox-core (= 3.0.0) | |
torquebox-transactions (= 3.0.0) | |
torquebox-naming (3.0.0-java) | |
torquebox-core (= 3.0.0) | |
torquebox-rake-support (3.0.0) | |
rake (>= 0.8.7) | |
torquebox-security (3.0.0-java) | |
torquebox-core (= 3.0.0) | |
torquebox-server (3.0.0-java) | |
torquebox (= 3.0.0) | |
torquebox-stomp (3.0.0) | |
torquebox-core (= 3.0.0) | |
torquebox-messaging (= 3.0.0) | |
torquebox-transactions (3.0.0) | |
torquebox-core (= 3.0.0) | |
torquebox-web (3.0.0-java) | |
yard (0.8.7) | |
PLATFORMS | |
java | |
DEPENDENCIES | |
fabrication (~> 2.7.2) | |
faker (~> 1.2.0) | |
jdbc-postgres | |
json-schema (~> 2.0) | |
kramdown | |
rack-test | |
rest-client | |
rspec (~> 2.13.0) | |
rspec-core (~> 2.13.1) | |
rspec-expectations (~> 2.13.0) | |
rspec-mocks (~> 2.13.1) | |
sequel | |
simplecov | |
sinatra | |
terminal-table | |
torquebox | |
torquebox-server | |
yard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From running 'jruby pg_array_test.rb' | |
I, [2013-09-03T18:16:50.143000 #6490] INFO -- : (0.000000s) SET standard_conforming_strings = ON | |
I, [2013-09-03T18:16:50.145000 #6490] INFO -- : (0.001000s) SET client_min_messages = 'WARNING' | |
I, [2013-09-03T18:16:50.174000 #6490] INFO -- : (0.027000s) SELECT version() | |
I, [2013-09-03T18:16:50.191000 #6490] INFO -- : (0.003000s) SELECT * FROM "sequel_constraint_validations" | |
I, [2013-09-03T18:16:50.252000 #6490] INFO -- : (0.012000s) SELECT "pg_attribute"."attname" AS "name", CAST("pg_attribute"."atttypid" AS integer) AS "oid", CAST("basetype"."oid" AS integer) AS "base_oid", format_type("basetype"."oid", "pg_type"."typtypmod") AS "db_base_type", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") LEFT OUTER JOIN "pg_type" AS "basetype" ON ("basetype"."oid" = "pg_type"."typbasetype") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."oid" = CAST(CAST('"nodes"' AS regclass) AS oid))) ORDER BY "pg_attribute"."attnum" | |
I, [2013-09-03T18:16:50.311000 #6490] INFO -- : (0.010000s) SELECT "indc"."relname" AS "name", "ind"."indisunique" AS "unique", "att"."attname" AS "column", "con"."condeferrable" AS "deferrable" FROM "pg_class" AS "tab" INNER JOIN "pg_index" AS "ind" ON ("ind"."indrelid" = "tab"."oid") INNER JOIN "pg_class" AS "indc" ON ("indc"."oid" = "ind"."indexrelid") INNER JOIN "pg_attribute" AS "att" ON (("att"."attrelid" = "tab"."oid") AND ("att"."attnum" = ANY("ind"."indkey"))) LEFT JOIN "pg_constraint" AS "con" ON ("con"."conname" = "indc"."relname") WHERE (("indc"."relkind" = 'i') AND ("ind"."indisprimary" IS FALSE) AND ("indexprs" IS NULL) AND ("indpred" IS NULL) AND ("indisvalid" IS TRUE) AND ("tab"."oid" = CAST(CAST('"nodes"' AS regclass) AS oid)) AND ("indisready" IS TRUE) AND ("indcheckxmin" IS FALSE)) ORDER BY "indc"."relname", (CASE "att"."attnum" WHEN "ind"."indkey"[0] THEN 0 WHEN "ind"."indkey"[1] THEN 1 WHEN "ind"."indkey"[2] THEN 2 WHEN "ind"."indkey"[3] THEN 3 WHEN "ind"."indkey"[4] THEN 4 WHEN "ind"."indkey"[5] THEN 5 WHEN "ind"."indkey"[6] THEN 6 WHEN "ind"."indkey"[7] THEN 7 WHEN "ind"."indkey"[8] THEN 8 WHEN "ind"."indkey"[9] THEN 9 WHEN "ind"."indkey"[10] THEN 10 WHEN "ind"."indkey"[11] THEN 11 WHEN "ind"."indkey"[12] THEN 12 WHEN "ind"."indkey"[13] THEN 13 WHEN "ind"."indkey"[14] THEN 14 WHEN "ind"."indkey"[15] THEN 15 WHEN "ind"."indkey"[16] THEN 16 WHEN "ind"."indkey"[17] THEN 17 WHEN "ind"."indkey"[18] THEN 18 WHEN "ind"."indkey"[19] THEN 19 WHEN "ind"."indkey"[20] THEN 20 WHEN "ind"."indkey"[21] THEN 21 WHEN "ind"."indkey"[22] THEN 22 WHEN "ind"."indkey"[23] THEN 23 WHEN "ind"."indkey"[24] THEN 24 WHEN "ind"."indkey"[25] THEN 25 WHEN "ind"."indkey"[26] THEN 26 WHEN "ind"."indkey"[27] THEN 27 WHEN "ind"."indkey"[28] THEN 28 WHEN "ind"."indkey"[29] THEN 29 WHEN "ind"."indkey"[30] THEN 30 WHEN "ind"."indkey"[31] THEN 31 ELSE 32 END) | |
I, [2013-09-03T18:16:50.319000 #6490] INFO -- : (0.001000s) BEGIN | |
I, [2013-09-03T18:16:50.323000 #6490] INFO -- : (0.001000s) INSERT INTO "nodes" ("hw_info") VALUES (ARRAY['serial=1']::text[]) RETURNING * | |
I, [2013-09-03T18:16:50.330000 #6490] INFO -- : (0.002000s) COMMIT | |
Array | |
Sequel::ValidationFailed: hw_info is not a valid sequel::postgres::pgarray | |
save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1301 | |
(root) at LOCAL/test.rb:33 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I, [2013-09-03T18:28:06.646000 #9688] INFO -- : (0.000000s) SET standard_conforming_strings = ON | |
I, [2013-09-03T18:28:06.648000 #9688] INFO -- : (0.001000s) SET client_min_messages = 'WARNING' | |
I, [2013-09-03T18:28:06.679000 #9688] INFO -- : (0.029000s) SELECT version() | |
I, [2013-09-03T18:28:06.724000 #9688] INFO -- : (0.012000s) SELECT "pg_attribute"."attname" AS "name", CAST("pg_attribute"."atttypid" AS integer) AS "oid", CAST("basetype"."oid" AS integer) AS "base_oid", format_type("basetype"."oid", "pg_type"."typtypmod") AS "db_base_type", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") LEFT OUTER JOIN "pg_type" AS "basetype" ON ("basetype"."oid" = "pg_type"."typbasetype") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."oid" = CAST(CAST('"nodes"' AS regclass) AS oid))) ORDER BY "pg_attribute"."attnum" | |
I, [2013-09-03T18:28:06.739000 #9688] INFO -- : (0.000000s) BEGIN | |
I, [2013-09-03T18:28:06.743000 #9688] INFO -- : (0.001000s) INSERT INTO "nodes" ("hw_info") VALUES (ARRAY['serial=1']::text[]) RETURNING * | |
I, [2013-09-03T18:28:06.750000 #9688] INFO -- : (0.003000s) COMMIT | |
Array | |
I, [2013-09-03T18:28:06.752000 #9688] INFO -- : (0.000000s) BEGIN | |
E, [2013-09-03T18:28:06.761000 #9688] ERROR -- : Java::OrgPostgresqlUtil::PSQLException: ERROR: array value must start with "{" or dimension information | |
Position: 33: UPDATE "nodes" SET "hw_info" = ('serial=1') WHERE ("id" = 1) | |
I, [2013-09-03T18:28:06.771000 #9688] INFO -- : (0.000000s) ROLLBACK | |
Sequel::DatabaseError: Java::OrgPostgresqlUtil::PSQLException: ERROR: array value must start with "{" or dimension information | |
Position: 33 | |
raise_error at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/database/misc.rb:402 | |
statement at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/adapters/jdbc.rb:604 | |
execute at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/adapters/jdbc.rb:259 | |
hold at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/connection_pool/threaded.rb:91 | |
synchronize at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/database/connecting.rb:234 | |
execute at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/adapters/jdbc.rb:258 | |
execute_dui at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/dataset/actions.rb:804 | |
update at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/dataset/actions.rb:717 | |
_update_without_checking at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1709 | |
_update at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1696 | |
_update_columns at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1690 | |
_save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1638 | |
around_update at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:892 | |
_save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1622 | |
around_save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:892 | |
_save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1605 | |
save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1305 | |
checked_transaction at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1763 | |
_transaction at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/database/transactions.rb:118 | |
transaction at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/database/transactions.rb:93 | |
hold at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/connection_pool/threaded.rb:104 | |
synchronize at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/database/connecting.rb:234 | |
transaction at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/database/transactions.rb:86 | |
checked_transaction at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1763 | |
save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1305 | |
checked_save_failure at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1751 | |
save at /home/lutter/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sequel-4.2.0/lib/sequel/model/base.rb:1305 | |
(root) at LOCAL/test.rb:33 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sequel' | |
require 'logger' | |
# Load Sequel extensions | |
Sequel.extension :core_extensions, :inflector | |
require 'sequel/plugins/serialization' | |
DB = Sequel.connect('jdbc:postgresql:DBNAME?user=USER&password=PASSWORD', :logger => Logger.new($stdout)) | |
DB.extension :pg_array | |
Sequel.extension :pg_array_ops | |
Sequel::Model.raise_on_save_failure = true | |
Sequel::Model.raise_on_typecast_failure = true | |
Sequel::Model.require_modification = true | |
Sequel::Model.strict_param_setting = true | |
Sequel::Model.plugin :defaults_setter | |
# output2 comes from commenting the next two lines out | |
Sequel::Model.plugin :constraint_validations | |
Sequel::Model.plugin :auto_validations | |
class Node < Sequel::Model; end | |
n = Node.create(:hw_info => ["serial=1"]) | |
puts n.hw_info.class.name | |
n.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment