Commit graph

47 commits

Author SHA1 Message Date
Iban Eguia Moraza
87ff6457b9
Exposing the Oid of PostgreSQL types (#2507)
* Exposing the Oid of PostgreSQL types

* Do not panic if OID is not set

* Update sqlx-postgres/src/type_info.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* cargo fmt

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-06-30 14:35:42 -07:00
Paolo Barbolini
37fdc2043b
Update bitflags to v2 (#2564) 2023-06-30 12:34:33 -07:00
Philip Kannegaard Hayes
1227d5d168
fix: ensure fresh test db's aren't accidentally deleted by do_cleanup (#2454)
If the first test thread is a bit slow after it acquires the
`DO_CLEANUP` permit, it can accidentally delete a fresh test db created
by another thread right before that other thread has a chance to open
its connection.

This fix simply records the current timestamp _before_ we acquire the
`DO_CLEANUP` permit and only cleans up test db's created before then.
2023-05-04 13:23:04 -07:00
Utkarsh Gupta
003878698e
chore(sqlx-postgres): replace dirs with home & etcetera (#2485) 2023-05-04 13:12:54 -07:00
Austin Bonander
ec60b1d32d fix: replace use of deprecated chrono APIs 2023-03-16 17:03:14 -07:00
Austin Bonander
0f6c377c12 fix: replace use of deprecated base64 functions 2023-03-16 17:03:14 -07:00
Austin Bonander
d43257e18a chore: cleanup, fix all non-deprecation warnings 2023-03-16 17:03:14 -07:00
Vladimir
d81b6fc08d fix: sqlx-postgres bigdecimal feature 2023-03-08 18:55:53 -08:00
Bram Geron
1ff6a2ac94 feat: support calling PostgreSQL procedures with the macros
Fixes #1449 (I think). I verified that the code fixes the new test.

I used INOUT in setup.sql because older versions of Postgres don't
support OUT parameters.
2023-03-03 19:36:39 -08:00
Nikhil Benesch
bb2baf2183 Don't run EXPLAIN nullability analysis on Materialize
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
2023-03-03 19:36:12 -08:00
Austin Bonander
c4b835c23a feat: add Connection::shrink_buffers, PoolConnection::close
closes #2372
2023-03-03 16:50:27 -08:00
Paolo Barbolini
c17c59fc4c Update dependencies 2023-02-22 15:49:46 -08:00
Craig Bester
9677430d67 fix: implement AnyConnectionBackend::as_migrate for databases 2023-02-22 15:09:41 -08:00
Austin Bonander
f05c884cdc
fix: remove readme entries for sqlx-mysql, sqlx-postgres, sqlx-sqlite 2023-02-21 15:44:03 -08:00
Austin Bonander
eade49cfb0
0.7.0-alpha.1 release 2023-02-21 14:56:54 -08:00
Thibs
c4130d45e3 Add client SSL authentication using key-file for Postgres, MySQL and MariaDB (#1850)
* use native-tls API

* Add client cert and key to MySQL connector

* Add client ssl tests for PostgreSQL

* Add client ssl tests for MariaDB and MySQL

* Adapt GA tests

* Fix RUSTFLAGS to run all tests

* Remove containers to free the DB port before running SSL auth tests

* Fix CI bad naming

* Use docker-compose down to remove also the network

* Fix main rebase

* Stop trying to stop service using docker-compose, simply use docker cmd

* Fix RUSTFLAGS for Postgres

* Name the Docker images for MariaDB and MySQL so we can stop them using their name

* Add the exception for mysql 5.7 not supporting compatible TLS version with RusTLS

* Rebase fixes

* Set correctly tls struct (fix merge)

* Handle Elliptic Curve variant for private key

* Fix tests suite

* Fix features in CI

* Add tests for Postgres 15 + rebase

* Python tests: fix exception for MySQL 5.7 + remove unneeded for loops

* CI: run SSL tests only when building with TLS support

---------

Co-authored-by: Barry Simons <linuxuser586@gmail.com>
2023-02-21 13:25:25 -08:00
Marco Cameriero
ab2ae26189 Postgres OID resolution query does not take into account current search_path (#2133)
* Fix oid resolution query

* Address review comments
2023-02-21 13:25:25 -08:00
Anthony Dodd
3440440564 Set whoami default-features to false (#2319)
* Fixed typo. (#2156)

* Set whoami default-features to false

Otherwise, whoami pulls in web-sys, wasm-bindgen and a BUNCH of
additional dependencies. This is really unnecessary, and if
someone has an actual use case where they are attempting to connect
to postgres from a browser, well ... they've probably already been
pwned by now. If it is deemed necessary, then add an additional
activation feature for that specific slew of deps.

---------

Co-authored-by: Chris Foster <cdbfoster@gmail.com>
2023-02-21 13:25:25 -08:00
Andrés Felipe Quintero Moreano
0534c9da81 fix: ensures recover from fail with PgCopyIn (#2179)
* CHANGELOG: mention that users should upgrade CLI

* fix: ensures recover from fail with PgCopyIn

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-02-21 13:25:25 -08:00
CosmicHorror
acaee75a30 Initial work to switch to tracing (#2185)
* Add tracing dep

* Switch over basic events

* Switch over dynamically enabled events

* Fix missing SocketAddr formatting

* More format fixing

* refactor: Apply tracing changes to new crate structure
2023-02-21 13:25:25 -08:00
Danilo Cianfrone
b72a52b066 fix: use owned Builder pattern for ConnectOptions (#2132)
* CHANGELOG: mention that users should upgrade CLI

* fix(sqlx-core): use owned builder pattern for ConnectOptions

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-02-21 13:25:25 -08:00
Luiz Carvalho
c09532864d feat: better database errors (#2109)
* feat(core): create error kind enum

* feat(core): add error kind for postgres

* feat(core): add error kind for sqlite

* feat(core): add error kind for mysql

* test(postgres): add error tests

* test(sqlite): add error tests

* test(mysql): add error tests

* fix(tests): fix tests rebasing

* refac(errors): add `ErrorKind::Other` variant
2023-02-21 13:25:25 -08:00
Austin Bonander
b5312c3b6f Break drivers out into separate crates, clean up some technical debt (#2039)
* WIP rt refactors

* refactor: break drivers out into separate crates

also cleans up significant technical debt
2023-02-21 13:25:25 -08:00
Ryan Leckey
04f56570a4 Collapse into 1 crate 2019-07-25 23:41:50 -07:00
Ryan Leckey
0703a1b91a Clean up connection methods a bit 2019-07-25 23:34:39 -07:00
Zachery Gyurkovitz
a49191fd46 Change get_results to produce a Stream 2019-07-25 11:54:36 -07:00
Zachery Gyurkovitz
2fb0c545b7 Implement get_results 2019-07-19 14:13:23 -07:00
Zachery Gyurkovitz
a4b5cfc408 Implement get_result 2019-07-19 14:12:07 -07:00
Zachery Gyurkovitz
6e7b18bc00 cargo fmt 2019-07-18 11:59:33 -07:00
Ryan Leckey
3599d50811 Use advance instead of set in read loop 2019-07-17 23:01:26 -07:00
Ryan Leckey
28168c414d Switched to a functional approach for front-end message construction 2019-07-17 23:01:05 -07:00
Ryan Leckey
908f228fb5 Update Rust and dependencies 2019-07-17 22:04:38 -07:00
Ryan Leckey
8589f0b907 Move to explicit prepare vs. implicit in execute builder 2019-07-17 12:43:46 -07:00
Ryan Leckey
c040c97cb3 Initial experiment with the low-level API and PREPARE + EXECUTE queries 2019-07-16 01:15:12 -07:00
Ryan Leckey
f161fa3178 Optimize encode of StartupMessage 2019-07-11 10:08:57 -07:00
Ryan Leckey
da42be7d0a Implement DataRow and CommandComplete 2019-06-30 07:07:57 -07:00
Ryan Leckey
cfe522034e Implement RowDescription 2019-06-30 06:35:30 -07:00
Ryan Leckey
e8ecbeda36 WIP Query 2019-06-29 21:57:04 -07:00
Ryan Leckey
c895ef52fe Decorate send/receive with trace logs for development 2019-06-29 21:40:33 -07:00
Ryan Leckey
735c8c366a Fix some lint warnings 2019-06-29 21:34:06 -07:00
Ryan Leckey
4c90e026f7 Improve performance and minor tweaks 2019-06-29 21:32:39 -07:00
Ryan Leckey
ee449d351b Update dependencies 2019-06-28 21:39:36 -07:00
Ryan Leckey
aa0b27af35 Minor clean up 2019-06-28 21:36:46 -07:00
Ryan Leckey
c59e65d65b Add some additional decode benchmarks 2019-06-28 00:30:43 -07:00
Ryan Leckey
5c73e220b6 Set up a connection benchmark using a mocked pg server 2019-06-26 12:49:08 -07:00
Ryan Leckey
8a4c5ea2fe Integrate new protocol crate to connection 2019-06-22 21:44:13 -07:00
Ryan Leckey
22f71df7c7 mason -> sqlx 2019-06-22 20:54:43 -07:00