Package org.jruby.pg.internal.messages

Examples of org.jruby.pg.internal.messages.Format


              RubyArray params = (RubyArray) args[1];

              Value [] values = new Value[params.getLength()];
              int [] oids = new int[params.getLength()];
              fillValuesAndFormat(context, params, values, oids);
              Format resultFormat = getFormat(context, args);
              set = postgresqlConnection.execQueryParams(query, values, resultFormat, oids);
            }

            if (set == null)
              return context.nil;
View Full Code Here


        }
        return context.nil;
    }

    private Format getFormat(ThreadContext context, IRubyObject [] args) {
      Format resultFormat = Format.Text;
      if (args.length == 3)
        resultFormat = ((RubyFixnum) args[2]).getLongValue() == 1 ? Format.Binary : Format.Text;
      return resultFormat;
    }
View Full Code Here

      RubySymbol value_s = context.runtime.newSymbol("value");
      RubySymbol type_s = context.runtime.newSymbol("type");
      RubySymbol format_s = context.runtime.newSymbol("format");
      for (int i = 0; i < params.getLength(); i++) {
        IRubyObject param = params.entry(i);
        Format valueFormat = Format.Text;
        if (param.isNil()) {
          values[i] = new Value(null, valueFormat);
        } else if (param instanceof RubyHash) {
          RubyHash hash = (RubyHash) params.get(i);
          IRubyObject value = hash.op_aref(context, value_s);
View Full Code Here

        fillValuesAndFormat(context, array, values, oids);
      } else {
        values = new Value[0];
        oids = new int[0];
      }
      Format format = getFormat(context, args);
      if (!async)
        return postgresqlConnection.execPrepared(queryName, values, format);
      postgresqlConnection.sendExecPrepared(queryName, values, format);
      return null;
    }
View Full Code Here

TOP

Related Classes of org.jruby.pg.internal.messages.Format

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.