Hello. I want to save array to database from sequel, and i cat do it, but
when i can take only string from database next,
It code example:
require "sequel"
require "pg"
Sequel.extension :pg_array, :core_extensions
DB = Sequel.connect("postgres://postgres@localhost/postgres")
DB.create_table? :items do
primary_key :id
column :positions, "integer[]"
end
items = DB[:items]
items.insert(positions: Sequel.pg_array([1, 2, 3]))
items.all.last[:positions] # <---- it is string. Not array
I know about this
<http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/pg_array_rb.html>
documentation, but i don't understand how to use it?
Can anybody help me?
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.