Code Monkey home page Code Monkey logo

pg_query.rs's People

Contributors

ankane avatar imor avatar lfittl avatar msepga avatar nalexpear avatar paupino avatar seanlinsley avatar skalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pg_query.rs's Issues

fatal error: sys/types.h not found

Hello. I'm trying to get set up on an M1 mac with the Getting started snippet. On running cargo build I get the error:

/Projects/simple_pgquery/pgquerytest/target/debug/build/pg_query-8200207fd30b02f3/out/pg_query.h:5:10: fatal error: 'sys/types.h' file not found

Wanted to ask if this was a known issue with a workaround. If not, I will assume it's an issue on my machine and keep trying to fix it. Thanks.

What are the goals of the `nodes()` functions?

Both NodesEnum::nodes() and protobuf::ParseResult::nodes() don't have documentation, although the latter hints

// Note: this doesn't iterate over every possible node type, since we only care about a subset of nodes.

Is the goal just to provide a helper function to extract ParseResult::{warnings, tables, aliases, cte_names, functions}?

I'm trying to do some more detailed parsing of a statement tree, and would like a "visitor" pattern. I need more information than scan() provides. Is it useful to extend the nodes function?

build error: program not found

Hello. I tried to run the following source code on Windows 10 and the build failed. I am seeking assistance in resolving this issue.

Code

use pg_query;

fn main() {
    let result = pg_query::parse("SELECT * FROM contacts");
    assert!(result.is_ok());
}

Error message

The project is located at E:\pg-query-test.

error: failed to run custom build command for `pg_query v0.8.2`

Caused by:
  process didn't exit successfully: `E:\pg-query-test\target\debug\build\pg_query-4000e504282b2f84\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-changed=.\libpg_query\Makefile
  cargo:rustc-link-search=native=E:\pg-query-test\target\debug\build\pg_query-b2e470b4f0427967\out
  cargo:rustc-link-lib=static=pg_query

  --- stderr
  Error: Error { kind: NotFound, message: "program not found" }

Environment

OS: Windows 10
pg_query: 0.8.2
cargo: 1.75.0-nightly
cmake: 3.28.1

Build error with bindgen 0.60.1

When using cargo build, I get the following error:

thread 'main' panicked at '"__atomic_wide_counter_struct_(unnamed_at_/usr/include/bits/atomic_wide_counter_h_28_3)" is not a valid Ident', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.66/src/fallback.rs:774:9

The same problem was observed here to be due to an old bindgen: danstiner/rust-u2f#114

rust-analyzer cannot figure out the type of Node

This is likely more a problem with rust-analyzer than this library, but I want to raise awareness because this harms ergonomics and I'd like to understand if there's a work around you all have figured out.

e.g. Even though type is Result<Vec<Node::SelectStmt, Error>> and this code compiles correctly, rust-analyzer provides Result<Vec<{unknown}, Error>>
Screen Shot 2022-07-15 at 9 42 44 AM

Anything that can be done to make this easier to work with?

Investigate SEGV on unknown address

The parallel test as currently written opens 10,000 threads that each call out to libpg_query at the same time. This error happens rarely, and so far only on CI.

https://github.com/pganalyze/pg_query.rs/runs/7419661487

LeakSanitizer:DEADLYSIGNAL
==4846==ERROR: LeakSanitizer: SEGV on unknown address 0x7f7999ae3ff8 (pc 0x5607592a63f4 bp 0x7f7595e56e60 sp 0x7f7595e565f0 T16383)
==4846==The signal is caused by a READ memory access.

Screen Shot 2022-07-19 at 6 43 13 PM

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.