sqlx/tests/postgres
Max Bruckner c57b46ceb6
Make Encode return a result (#3126)
* Make encode and encode_by_ref fallible

This only changes the trait for now and makes it compile, calling .expect() on all users. Those will be removed in a later commit.

* PgNumeric: Turn TryFrom Decimal to an infallible From

* Turn panics in Encode implementations into errors

* Add Encode error analogous to the Decode error

* Propagate decode errors through Arguments::add

This pushes the panics one level further to mostly bind calls. Those will also be removed later.

* Only check argument encoding at the end

* Use Result in Query internally

* Implement query_with functions in terms of _with_result

* Surface encode errors when executing a query.

* Remove remaining panics in AnyConnectionBackend implementations

* PostgreSQL BigDecimal: Return encode error immediately

* Arguments: Add len method to report how many arguments were added

* Query::bind: Report which argument failed to encode

* IsNull: Add is_null method

* MySqlArguments: Replace manual bitmap code with NullBitMap helper type

* Roll back buffer in MySqlArguments if encoding fails

* Roll back buffer in SqliteArguments if encoding fails

* Roll back PgArgumentBuffer if encoding fails
2024-05-31 12:42:36 -07:00
..
fixtures feat: implement testing utilities (#2001) 2022-08-02 14:38:12 -07:00
migrations feat: implement testing utilities (#2001) 2022-08-02 14:38:12 -07:00
migrations_no_tx feat: no tx migration (#3181) 2024-04-19 15:42:44 -07:00
migrations_reversible fix: ensure migration progress is not lost for PG, mysql and sqlite (#1991) 2022-09-12 17:52:04 -07:00
migrations_simple fix: ensure migration progress is not lost for PG, mysql and sqlite (#1991) 2022-09-12 17:52:04 -07:00
derives.rs derive FromRow: sqlx(default) for all fields (#2801) 2023-10-17 16:13:40 -07:00
describe.rs feat(postgres): expose PgTypeKind 2020-07-24 07:28:59 -07:00
Dockerfile Add client SSL authentication using key-file for Postgres, MySQL and MariaDB (#1850) 2023-02-21 13:25:25 -08:00
error.rs feat: better database errors (#2109) 2023-02-21 13:25:25 -08:00
macros.rs feat(citext): support postgres citext (#2478) 2023-10-11 18:03:17 -07:00
migrate.rs feat: no tx migration (#3181) 2024-04-19 15:42:44 -07:00
pg_hba.conf Add client SSL authentication using key-file for Postgres, MySQL and MariaDB (#1850) 2023-02-21 13:25:25 -08:00
postgres.rs Make Encode return a result (#3126) 2024-05-31 12:42:36 -07:00
setup.sql feat(citext): support postgres citext (#2478) 2023-10-11 18:03:17 -07:00
test-attr.rs feat: no tx migration (#3181) 2024-04-19 15:42:44 -07:00
test-query.sql refactor(macros): remove ResultExt and macro_result!() 2020-07-21 21:19:31 -07:00
types.rs feat: Text adapter (#2894) 2023-11-22 17:06:47 -08:00