On Sunday, March 4, 2018 at 8:02:28 AM UTC-8, Dmitriy Rotatyy wrote:
>
> 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.extension :pg_array # need to load the extension into the Database
object, as the documentation shows
>
> 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.