Sha256: 5c958965f70ec284ebc95b836f44ad92965e89d631919e91bedd8f05dc42794d

Contents?: true

Size: 460 Bytes

Versions: 5

Compression:

Stored size: 460 Bytes

Contents

# -*- ruby -*-

require 'ysql'

c = YSQL.connect(dbname: 'test' )

# this one works:
c.exec( "DROP TABLE IF EXISTS foo" )
c.exec( "CREATE TABLE foo (strings character varying[]);" )

# But using a prepared statement works:
c.set_error_verbosity(YSQL::PQERRORS_VERBOSE )
c.prepare( 'stmt', "INSERT INTO foo VALUES ($1);" )

# This won't work
#c.exec_prepared( 'stmt', ["ARRAY['this','that']"] )

# but this will:
c.exec_prepared( 'stmt', ["{'this','that'}"] )

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yugabytedb-ysql-0.7 sample/array_insert.rb
yugabytedb-ysql-0.6 sample/array_insert.rb
yugabytedb-ysql-0.5 sample/array_insert.rb
yugabytedb-ysql-0.4 sample/array_insert.rb
yugabytedb-ysql-0.3 sample/array_insert.rb