Code Monkey home page Code Monkey logo

pg_exec_array_params's People

Contributors

razum2um avatar

Watchers

 avatar  avatar  avatar

pg_exec_array_params's Issues

Upgrade pg_query dependency to 1.3.0

Hi @razum2um,

arm64-based machines cannot install the gem due to the dependency pg_query 1.2.0 not supporting arm.
The version 1.3.0 adds support to ARM and should solve the issue (see Changelog).

I am facing the issue on a M1 macbook and it might happen more and more as the new mac hardware transitions to ARM.

Would it be possible to upgrade the dependency to 1.3.0?

(See this issue for reference)

Process ParamRef in ResTarget->val

Gem processes only REXPR inside A_EXPR (e.g. right part of filter clauses or assignments), but this fails:

> PG::Connection.include(PgExecArrayParams)
=> PG::Connection
> sql = "SELECT $1"
=> "SELECT $1"
> User.connection.raw_connection.exec_array_params(sql, [[1,2]])
PG::ProtocolViolation: ERROR:  bind message supplies 0 parameters, but prepared statement "" requires 1
from /lib/pg_exec_array_params/query.rb:25:in `exec_params'

AST looks like:

> PgQuery.parse sql
=> #<PgQuery:0x00007f84741fc1d8
 @aliases=nil,
 @cte_names=nil,
 @query="SELECT $1",
 @tables=nil,
 @tree=[{"RawStmt"=>{"stmt"=>{"SelectStmt"=>{"targetList"=>[{"ResTarget"=>{"val"=>{"ParamRef"=>{"number"=>1, "location"=>7}}, "location"=>7}}], "op"=>0}}}}],
 @warnings=[]>

p.s. reply with gem link to https://stackoverflow.com/questions/30409360/ruby-pg-gem-use-array-as-param-with-exec-params

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.