* Include test case for regular subtransactions
While using COPY and subtransactions I kept running into errors.
This test case documents that error, it currently fails with:
Error: encountered unexpected or invalid data: expecting ParseComplete but received CommandComplete
* PostgreSQL Copy: Consume ReadyForQuery on error
When a COPY statement was in error inside a subtransaction,
a Protocol Error used to be raised. By consuming the ReadyForQuery
message when there is an error, we no longer have this issue.
* fix(postgres) : int type conversion while decoding
* Check value buffer len when decoding integer type in postgres
* decode from octal for postgres i8
---------
Co-authored-by: RaghavRox <66472843+RaghavRox@users.noreply.github.com>
* test: add a failing test
* feat: add no_tx to migration struct
* feat: execute migration with no tx block
* fix: expected string literal compilation error
* test: update no tx to content comment
* refactor: use the sql comment instead of file name semantics
* docs: remove no_tx from file format comment
* fix: remove filename matches
* fix: messed up merge
* refactor: dedupe migration
* fix: move comment to where it makes sense
* fix: linter error
Breaking changes:
* integer decoding will now loudly error on overflow instead of silently truncating.
* some usages of the query!() macros might change an i32 to an i64.
Also adds support for *decoding* `u64`s because there's no reason not to.
Closes#3179
Also clarifies the handling of `TIME` (we never realized it's used for both time-of-day and signed intervals) and adds appropriate impls for `std::time::Duration`, `time::Duration`, `chrono::TimeDelta`
Add bounds such that cyclic associated types are equal to themselves.
```
<T as Connection>::Database as Database>::Connection == T
<T as ConnectOptions>::Connection as Connection>::Options == T
<T as Row>::Database as Database>::Row == T
<T as Column>::Database as Database>::Column == T
<T as Value>::Database as Database>::Value == T
```
* HasValueRef, HasArguments, HasStatement -> Database GATs
replace the associated types from the generic traits
`HasValueRef<'r>`, `HasArguments<'q>` and `HasStatement<'q>`
with generic associated types in `Database`
* fixup after rebase
---------
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
* feat: add get_url to connect options
Add a get_url to connect options and implement it for all needed types;
include get_filename for sqlite. These changes make it easier to test
sqlx.
* refactor: use expect with message
* refactor: change method name to `to_url_lossy`
* fix: remove unused imports
* feat(mysql): provide options to disable default connection settings after connecting
* style(mysql): remove unecessary newlines and run rustfmt
* feat(mysql): allow to pass a custom timezone to the database after connecting
docs(mysql): improve docs for options set_names and no_engine_substitution
* Use `create_new` instead of `atomic-file-write`
This provides the same functionality but without temporary files, platform-specific code, fragility of `O_TMPFILE` support, and an extra dependency.
* Properly handle acceptable failure cases
* Consider `PermissionDenied` as acceptable
Apparently this can occur on Windows.
---------
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>