Guest User

Untitled

a guest
Aug 26th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. >> DataMapper.setup(:default, 'postgres://dashboard:devp@ss@localhost/dashboard_dev')
  2. => #<DataMapper::Adapters::PostgresAdapter:0x24ae2d66 @normalized_uri=#<struct DataObjects::URI scheme="postgres", user="dashboard", password="rubyp@ss", host="localhost", port=nil, path="/dashboard_dev", query=nil, fragment=nil>, name:default, options{"scheme"=>"postgres", "user"=>"dashboard", "password"=>"devp@ss", "host"=>"localhost", "port"=>nil, "path"=>"/dashboard_dev", "query"=>nil, "fragment"=>nil, "adapter"=>"postgres"}, field_naming_conventionDataMapper::NamingConventions::Field::Underscored, resource_naming_conventionDataMapper::NamingConventions::Resource::UnderscoredAndPluralized
  3. >>
  4. ?> class Stat
  5. >> include DataMapper::Resource
  6. >>
  7. ?> property :id, Serial
  8. >> property :device_id, Integer
  9. >> property :metric_id, Integer
  10. >> property :value, Integer, :min => -9223372036854775807, :max => 9223372036854775807
  11. >> property :string_value, String
  12. >> property :created_at, DateTime
  13. >> property :updated_at, DateTime
  14. >> end
  15. => #<DataMapper::Property::DateTime @model=Stat @name=:updated_at>
  16. >>
  17. ?> s = Stat.new(:device_id => 10, :metric_id => 10, :value => 223372036854775807)
  18. => #<Stat @id=nil @device_id=10 @metric_id=10 @value=223372036854775807 @string_value=nil @created_at=nil @updated_at=nil>
  19. >> s.save
  20. Java::JavaLang::NumberFormatException: For input string: "223372036854775807"
  21. from java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
  22. from java.lang.Integer.parseInt(Integer.java:461)
  23. from java.lang.Integer.parseInt(Integer.java:499)
  24. from data_objects.drivers.AbstractDriverDefinition.setPreparedStatementParam(AbstractDriverDefinition.java:421)
  25. from do_postgres.PostgresDriverDefinition.setPreparedStatementParam(PostgresDriverDefinition.java:103)
  26. from data_objects.Command.prepareStatementFromArgs(Command.java:580)
  27. from data_objects.Command.execute_non_query(Command.java:143)
  28. from data_objects.Command$i_method_0_1$RUBYINVOKER$execute_non_query.call(data_objects/Command$i_method_0_1$RUBYINVOKER$execute_non_query.gen:65535)
  29. from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:638)
  30. from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202)
  31. from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:349)
  32. from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:228)
  33. from org.jruby.ast.CallSpecialArgNode.interpret(CallSpecialArgNode.java:71)
  34. from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
  35. from org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  36. from org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
  37. ... 237 levels...
  38. from org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
  39. from org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
  40. from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
  41. from org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  42. from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
  43. from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:174)
  44. from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
  45. from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
  46. from opt.jruby.bin.jirb.__file__(jirb:13)
  47. from opt.jruby.bin.jirb.load(jirb)
  48. from org.jruby.Ruby.runScript(Ruby.java:690)
  49. from org.jruby.Ruby.runNormally(Ruby.java:573)
  50. from org.jruby.Ruby.runFromMain(Ruby.java:416)
  51. from org.jruby.Main.run(Main.java:286)
  52. from org.jruby.Main.run(Main.java:128)
  53. from org.jruby.Main.main(Main.java:97)>>
  54. ?>
  55. ?>
  56. ?> >> => nil
  57. Mark-Cotners-MacBook-Pro:~ markcotner$ jruby --version
  58. jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2010-12-03 9cf97c3) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_22) [x86_64-java]
  59. Mark-Cotners-MacBook-Pro:~ markcotner$ jruby -S gem list dm-core
  60.  
  61. *** LOCAL GEMS ***
  62.  
  63. dm-core (1.0.2)
Add Comment
Please, Sign In to add comment