Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ParameterStatus and fix macro error with CockroachDB #1248

Closed
wants to merge 29 commits into from

Conversation

altanozlu
Copy link
Contributor

CockroachDB currently can't handle explain with verbose and json params, so query! wasn't working .
This patch implements parameter_status_map for PgConnection and if crdb_version exists in parameter_status_map it doesn't use nullables_from_explain function.

altanozlu and others added 4 commits May 25, 2021 17:50
* readme: Fix inconsistent list style

* readme: Improve text alignment

* readme: Fix missing links

* readme: Consistently use code formatting for runtime & TLS crates and dedup links

* readme: Add SQLx is not an ORM section

* readme: Improve documentation about offline mode
@altanozlu
Copy link
Contributor Author

Hi @abonander, can u check pr ?

Co-authored-by: Austin Bonander <austin@launchbadge.com>
abonander and others added 19 commits July 14, 2021 14:29
* NewRowid, Column opcodes, better pointer handling

* Implement tracking of column typing on sqlite explain parser

* fmt for sqlite column typing for explain parsing

Co-authored-by: marshoepial <marshoepial@gmail.com>
…launchbadge#1332)

* fix(macros): tell the compiler about external files/env vars to watch

closes launchbadge#663
closes launchbadge#681

* feat(cli): add `migrate` subcommand for generating a build script

suggest embedding migrations on `sqlx migrate add` in a new project
)

This fixes a panic when sharing an SQLite connection pool between tokio runtime and actix runtime
* fix test suite

* rustfmt

* need Row

* test: fix integration test scripts and update the upstream supported databases

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): update supported databases

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): use `pg_isready` instead of `sleep` to avoid error cause by database not ready

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* feat(core): add `trait PgConnectionInfo` for connection parameter status from server

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* test(postgres): fix integration test for postgres

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* test(mysql): fix integration tests

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): test database against the oldest and newest supported versions

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* docs(core): document `trait PgConnectionInfo`

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

Co-authored-by: Montana Low <montanalow@gmail.com>
Signed-off-by: Atkins Chang <atkinschang@gmail.com>
* sqlite: use Arc instead of Copy-able StatementHandle

This guarantees that StatementHandle is never used after calling
`sqlite3_finalize`. Now `sqlite3_finalize` is only called when
StatementHandle is dropped.

(cherry picked from commit 5eebc05)

* sqlite: use Weak poiter to StatementHandle in the worker

Otherwise some tests fail to close connection.

(cherry picked from commit 5461eee)

* Fix segfault due to race condition in sqlite (launchbadge#1300)

(cherry picked from commit bb62cf7)

* fix(sqlite): run `sqlite3_reset()` in `StatementWorker`

this avoids possible race conditions without using a mutex

* fix(sqlite): have `StatementWorker` keep a strong ref to `ConnectionHandle`

this should prevent the database handle from being finalized before all statement handles
have been finalized

* fix(sqlite/test): make `concurrent_resets_dont_segfault` runtime-agnostic

Co-authored-by: link2xt <link2xt@testrun.org>
Co-authored-by: Adam Cigánek <adam.ciganek@gmail.com>
…e#1255)

* reference fetch_all() in query macros

* add example for using transactions in postgres
@abonander
Copy link
Collaborator

@altanozlu sorry for the delay, if you still want to get this merged do you mind rebasing on the latest master?

frxstrem and others added 2 commits August 16, 2021 16:36
)

* fix: wait until ready after executing other helper queries while pg quering is executing

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* fix: use tls parameter for testing target

Signed-off-by: Atkins Chang <atkinschang@gmail.com>
When `clap_derive 3.0.0-beta.4` released, new invocations of `cargo install sqlx-cli` would try to compile that against `clap 3.0.0-beta.2` which caused some breakages.

Until `clap 3.0.0` proper is released, we need to pin both versions to insure against potential breakages from automatic upgrades.

closes launchbadge#1378
@altanozlu
Copy link
Contributor Author

sure

@altanozlu
Copy link
Contributor Author

oh! i'll make new pr

@altanozlu altanozlu closed this Aug 17, 2021
@altanozlu altanozlu deleted the crdb_version_check branch August 17, 2021 18:14
@palfrey
Copy link

palfrey commented Jan 18, 2022

For reference for anyone trying to figure out where this went, #1386 appears to be the replacement

benesch added a commit to MaterializeInc/sqlx that referenced this pull request Jan 8, 2023
Materialize [0] is a PostgreSQL-like database that, similar to
CockroachDB, does not support PostgreSQL's `EXPLAIN` output. Extend the
fix from PR launchbadge#1248 to Materialize, too, so that sqlx can still be used
with Materialize.

See launchbadge#1248.

[0]: https://materialize.com
benesch added a commit to benesch/sqlx that referenced this pull request Mar 3, 2023
Materialize [0] is a PostgreSQL-like database that, similar to
CockroachDB, does not support PostgreSQL's `EXPLAIN` output. Extend the
fix from PR launchbadge#1248 to Materialize, too, so that sqlx can still be used
with Materialize.

See launchbadge#1248.

[0]: https://materialize.com
abonander pushed a commit that referenced this pull request Mar 4, 2023
Materialize [0] is a PostgreSQL-like database that, similar to
CockroachDB, does not support PostgreSQL's `EXPLAIN` output. Extend the
fix from PR #1248 to Materialize, too, so that sqlx can still be used
with Materialize.

See #1248.

[0]: https://materialize.com
Aandreba pushed a commit to Aandreba/sqlx that referenced this pull request Mar 31, 2023
Materialize [0] is a PostgreSQL-like database that, similar to
CockroachDB, does not support PostgreSQL's `EXPLAIN` output. Extend the
fix from PR launchbadge#1248 to Materialize, too, so that sqlx can still be used
with Materialize.

See launchbadge#1248.

[0]: https://materialize.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet