Commit graph

2599 commits

Author SHA1 Message Date
df15dfe7bb
fix: support postgres custom type
See issue https://github.com/launchbadge/sqlx/issues/1920
2025-01-19 21:22:41 +09:00
joeydewaal
f6d2fa3a3d
fix: handle nullable values by printing NULL instead of panicking (#3686) 2025-01-15 17:08:16 -08:00
tison
838a239a2c
docs: add example for postgres enums with type TEXT (#3655)
* docs: add example for postgres enums with type TEXT

Signed-off-by: tison <wander4096@gmail.com>

* revert GitHub naming

Signed-off-by: tison <wander4096@gmail.com>

* add note

Signed-off-by: tison <wander4096@gmail.com>

---------

Signed-off-by: tison <wander4096@gmail.com>
2025-01-15 08:41:57 -08:00
Paolo Barbolini
8b5277462d build(deps): bump semver compatible dependencies
Fixes the following cargo-audit feedback:

```
Crate:     openssl
Version:   0.10.64
Title:     `MemBio::get_buf` has undefined behavior with empty buffers
Date:      2024-07-21
ID:        RUSTSEC-2024-0357
URL:       https://rustsec.org/advisories/RUSTSEC-2024-0357
Solution:  Upgrade to >=0.10.66
Dependency tree:
openssl 0.10.64
├── sqlx-cli 0.8.3
└── native-tls 0.2.11
    └── sqlx-core 0.8.3
        ├── sqlx-sqlite 0.8.3
        │   ├── sqlx-macros-core 0.8.3
        │   │   └── sqlx-macros 0.8.3
        │   │       └── sqlx 0.8.3
        │   │           ├── sqlx-test 0.1.0
        │   │           │   └── sqlx 0.8.3
        │   │           ├── sqlx-sqlite 0.8.3
        │   │           ├── sqlx-postgres 0.8.3
        │   │           │   ├── sqlx-macros-core 0.8.3
        │   │           │   └── sqlx 0.8.3
        │   │           ├── sqlx-mysql 0.8.3
        │   │           │   ├── sqlx-macros-core 0.8.3
        │   │           │   └── sqlx 0.8.3
        │   │           ├── sqlx-example-sqlite-todos 0.1.0
        │   │           ├── sqlx-example-postgres-transaction 0.1.0
        │   │           ├── sqlx-example-postgres-todos 0.1.0
        │   │           ├── sqlx-example-postgres-mockable-todos 0.1.0
        │   │           ├── sqlx-example-postgres-listen 0.1.0
        │   │           ├── sqlx-example-postgres-json 0.1.0
        │   │           ├── sqlx-example-postgres-files 0.1.0
        │   │           ├── sqlx-example-postgres-chat 0.1.0
        │   │           ├── sqlx-example-postgres-axum-social 0.1.0
        │   │           ├── sqlx-example-mysql-todos 0.1.0
        │   │           ├── sqlx-core 0.8.3
        │   │           └── sqlx-cli 0.8.3
        │   └── sqlx 0.8.3
        ├── sqlx-postgres 0.8.3
        ├── sqlx-mysql 0.8.3
        ├── sqlx-macros-core 0.8.3
        ├── sqlx-macros 0.8.3
        └── sqlx 0.8.3

Crate:     futures-util
Version:   0.3.30
Warning:   yanked
Dependency tree:
futures-util 0.3.30
├── tower-http 0.3.5
│   └── axum 0.5.17
│       └── sqlx-example-postgres-axum-social 0.1.0
├── tower 0.4.13
│   ├── tower-http 0.3.5
│   ├── sqlx-example-postgres-axum-social 0.1.0
│   └── axum 0.5.17
├── sqlx-sqlite 0.8.3
│   ├── sqlx-macros-core 0.8.3
│   │   └── sqlx-macros 0.8.3
│   │       └── sqlx 0.8.3
│   │           ├── sqlx-test 0.1.0
│   │           │   └── sqlx 0.8.3
│   │           ├── sqlx-sqlite 0.8.3
│   │           ├── sqlx-postgres 0.8.3
│   │           │   ├── sqlx-macros-core 0.8.3
│   │           │   └── sqlx 0.8.3
│   │           ├── sqlx-mysql 0.8.3
│   │           │   ├── sqlx-macros-core 0.8.3
│   │           │   └── sqlx 0.8.3
│   │           ├── sqlx-example-sqlite-todos 0.1.0
│   │           ├── sqlx-example-postgres-transaction 0.1.0
│   │           ├── sqlx-example-postgres-todos 0.1.0
│   │           ├── sqlx-example-postgres-mockable-todos 0.1.0
│   │           ├── sqlx-example-postgres-listen 0.1.0
│   │           ├── sqlx-example-postgres-json 0.1.0
│   │           ├── sqlx-example-postgres-files 0.1.0
│   │           ├── sqlx-example-postgres-chat 0.1.0
│   │           ├── sqlx-example-postgres-axum-social 0.1.0
│   │           ├── sqlx-example-mysql-todos 0.1.0
│   │           ├── sqlx-core 0.8.3
│   │           │   ├── sqlx-sqlite 0.8.3
│   │           │   ├── sqlx-postgres 0.8.3
│   │           │   ├── sqlx-mysql 0.8.3
│   │           │   ├── sqlx-macros-core 0.8.3
│   │           │   ├── sqlx-macros 0.8.3
│   │           │   └── sqlx 0.8.3
│   │           └── sqlx-cli 0.8.3
│   └── sqlx 0.8.3
├── sqlx-postgres 0.8.3
├── sqlx-mysql 0.8.3
├── sqlx-core 0.8.3
├── hyper 0.14.28
│   └── axum 0.5.17
├── futures-executor 0.3.30
│   ├── sqlx-sqlite 0.8.3
│   └── futures 0.3.30
│       ├── sqlx-example-sqlite-todos 0.1.0
│       ├── sqlx-example-postgres-transaction 0.1.0
│       ├── sqlx-example-postgres-todos 0.1.0
│       ├── sqlx-example-postgres-mockable-todos 0.1.0
│       ├── sqlx-example-postgres-listen 0.1.0
│       ├── sqlx-example-postgres-json 0.1.0
│       ├── sqlx-example-postgres-chat 0.1.0
│       ├── sqlx-example-mysql-todos 0.1.0
│       ├── sqlx-cli 0.8.3
│       ├── sqlx 0.8.3
│       └── criterion 0.5.1
│           └── sqlx 0.8.3
├── futures 0.3.30
├── axum-core 0.2.9
│   └── axum 0.5.17
└── axum 0.5.17

Crate:     url
Version:   2.5.3
Warning:   yanked
Dependency tree:
url 2.5.3
├── validator 0.16.1
│   └── sqlx-example-postgres-axum-social 0.1.0
├── sqlx-sqlite 0.8.3
│   ├── sqlx-macros-core 0.8.3
│   │   └── sqlx-macros 0.8.3
│   │       └── sqlx 0.8.3
│   │           ├── sqlx-test 0.1.0
│   │           │   └── sqlx 0.8.3
│   │           ├── sqlx-sqlite 0.8.3
│   │           ├── sqlx-postgres 0.8.3
│   │           │   ├── sqlx-macros-core 0.8.3
│   │           │   └── sqlx 0.8.3
│   │           ├── sqlx-mysql 0.8.3
│   │           │   ├── sqlx-macros-core 0.8.3
│   │           │   └── sqlx 0.8.3
│   │           ├── sqlx-example-sqlite-todos 0.1.0
│   │           ├── sqlx-example-postgres-transaction 0.1.0
│   │           ├── sqlx-example-postgres-todos 0.1.0
│   │           ├── sqlx-example-postgres-mockable-todos 0.1.0
│   │           ├── sqlx-example-postgres-listen 0.1.0
│   │           ├── sqlx-example-postgres-json 0.1.0
│   │           ├── sqlx-example-postgres-files 0.1.0
│   │           ├── sqlx-example-postgres-chat 0.1.0
│   │           ├── sqlx-example-postgres-axum-social 0.1.0
│   │           ├── sqlx-example-mysql-todos 0.1.0
│   │           ├── sqlx-core 0.8.3
│   │           │   ├── sqlx-sqlite 0.8.3
│   │           │   ├── sqlx-postgres 0.8.3
│   │           │   ├── sqlx-mysql 0.8.3
│   │           │   ├── sqlx-macros-core 0.8.3
│   │           │   ├── sqlx-macros 0.8.3
│   │           │   └── sqlx 0.8.3
│   │           └── sqlx-cli 0.8.3
│   └── sqlx 0.8.3
├── sqlx-macros-core 0.8.3
├── sqlx-core 0.8.3
└── sqlx 0.8.3
```

Result of cargo update:

```
    Updating crates.io index
    Updating addr2line v0.21.0 -> v0.24.2
    Removing adler v1.0.2
      Adding adler2 v2.0.0
    Removing ahash v0.8.11
    Updating aho-corasick v1.1.2 -> v1.1.3
    Updating allocator-api2 v0.2.16 -> v0.2.21
    Updating anstream v0.6.13 -> v0.6.18
    Updating anstyle v1.0.6 -> v1.0.10
    Updating anstyle-parse v0.2.3 -> v0.2.6
    Updating anstyle-query v1.0.2 -> v1.1.2
    Updating anstyle-wincon v3.0.2 -> v3.0.6
    Updating anyhow v1.0.81 -> v1.0.95
    Updating arrayvec v0.7.4 -> v0.7.6
    Updating assert_cmd v2.0.14 -> v2.0.16
    Updating async-channel v2.2.0 -> v2.3.1
    Updating async-executor v1.8.0 -> v1.13.1
    Updating async-io v2.3.2 -> v2.4.0
    Updating async-lock v3.3.0 -> v3.4.0
    Updating async-task v4.7.0 -> v4.7.1
    Updating async-trait v0.1.77 -> v0.1.85
    Updating autocfg v1.1.0 -> v1.4.0
    Updating aws-lc-rs v1.8.0 -> v1.12.0
    Updating aws-lc-sys v0.19.0 -> v0.24.1
    Updating backtrace v0.3.69 -> v0.3.74
    Updating base64 v0.22.0 -> v0.22.1
    Removing basic-toml v0.1.9
    Updating bigdecimal v0.4.3 -> v0.4.7
    Updating bindgen v0.69.4 -> v0.69.5 (latest: v0.71.1)
    Updating bitflags v2.4.2 -> v2.7.0
    Updating blocking v1.5.1 -> v1.6.1
    Updating borsh v1.5.1 -> v1.5.3
    Updating borsh-derive v1.5.1 -> v1.5.3
    Updating bstr v1.9.1 -> v1.11.3
    Updating bumpalo v3.15.4 -> v3.16.0
    Updating bytes v1.5.0 -> v1.9.0
    Updating camino v1.1.6 -> v1.1.9
    Updating cargo-platform v0.1.7 -> v0.1.9
    Updating cc v1.1.6 -> v1.2.8
      Adding cfg_aliases v0.1.1 (latest: v0.2.1)
    Updating chrono v0.4.35 -> v0.4.39
    Updating clap v4.5.2 -> v4.5.26
    Updating clap_builder v4.5.2 -> v4.5.26
    Updating clap_complete v4.5.1 -> v4.5.42
    Updating clap_derive v4.5.0 -> v4.5.24
    Updating clap_lex v0.7.0 -> v0.7.4
    Updating cmake v0.1.50 -> v0.1.52
    Updating colorchoice v1.0.0 -> v1.0.3
    Updating concurrent-queue v2.4.0 -> v2.5.0
    Updating console v0.15.8 -> v0.15.10
      Adding core-foundation v0.10.0
    Updating core-foundation-sys v0.8.6 -> v0.8.7
    Updating cpufeatures v0.2.12 -> v0.2.16
    Updating crc v3.0.1 -> v3.2.1
    Updating crossbeam-deque v0.8.5 -> v0.8.6
    Updating crossbeam-queue v0.3.11 -> v0.3.12
    Updating crossbeam-utils v0.8.19 -> v0.8.21
    Updating darling v0.20.8 -> v0.20.10
    Updating darling_core v0.20.8 -> v0.20.10
    Updating darling_macro v0.20.8 -> v0.20.10
    Updating der v0.7.8 -> v0.7.9
    Updating dunce v1.0.4 -> v1.0.5
    Updating either v1.10.0 -> v1.13.0
    Updating encode_unicode v0.3.6 -> v1.0.0
    Updating env_filter v0.1.0 -> v0.1.3
    Updating env_logger v0.11.3 -> v0.11.6
      Adding erased-serde v0.4.5
    Updating errno v0.3.8 -> v0.3.10
    Removing event-listener v4.0.3
    Removing event-listener v5.2.0
      Adding event-listener v5.4.0
    Removing event-listener-strategy v0.4.0
    Removing event-listener-strategy v0.5.0
      Adding event-listener-strategy v0.5.3
    Updating fastrand v2.0.1 -> v2.3.0
    Updating filetime v0.2.23 -> v0.2.25
    Removing finl_unicode v1.2.0
    Updating flume v0.11.0 -> v0.11.1
    Updating foldhash v0.1.3 -> v0.1.4
    Updating futures v0.3.30 -> v0.3.31
    Updating futures-channel v0.3.30 -> v0.3.31
    Updating futures-core v0.3.30 -> v0.3.31
    Updating futures-executor v0.3.30 -> v0.3.31
    Updating futures-io v0.3.30 -> v0.3.31
    Updating futures-lite v2.2.0 -> v2.5.0
    Updating futures-macro v0.3.30 -> v0.3.31
    Updating futures-sink v0.3.30 -> v0.3.31
    Updating futures-task v0.3.30 -> v0.3.31
    Updating futures-util v0.3.30 -> v0.3.31
    Updating getrandom v0.2.12 -> v0.2.15
    Updating gimli v0.28.1 -> v0.31.1
    Updating glob v0.3.1 -> v0.3.2
    Updating half v2.4.0 -> v2.4.1
    Removing hashbrown v0.14.5
      Adding hermit-abi v0.4.0
    Updating httparse v1.8.0 -> v1.9.5
    Updating hyper v0.14.28 -> v0.14.32 (latest: v1.5.2)
    Updating iana-time-zone v0.1.60 -> v0.1.61
    Updating indexmap v2.2.5 -> v2.7.0
    Updating instant v0.1.12 -> v0.1.13
    Updating is-terminal v0.4.12 -> v0.4.13
      Adding is_terminal_polyfill v1.70.1
    Updating itoa v1.0.10 -> v1.0.14
    Updating jobserver v0.1.31 -> v0.1.32
    Updating js-sys v0.3.69 -> v0.3.76
    Updating lazy_static v1.4.0 -> v1.5.0
    Updating libc v0.2.153 -> v0.2.169
    Updating libloading v0.8.4 -> v0.8.6
    Updating libm v0.2.8 -> v0.2.11
    Updating libredox v0.0.1 -> v0.1.3
    Updating linux-raw-sys v0.4.13 -> v0.4.15 (latest: v0.7.0)
    Updating litemap v0.7.3 -> v0.7.4
    Updating lock_api v0.4.11 -> v0.4.12
    Updating log v0.4.21 -> v0.4.24
    Updating lru v0.12.3 -> v0.12.5
    Updating mac_address v1.1.5 -> v1.1.7
    Updating memchr v2.7.1 -> v2.7.4
      Adding memoffset v0.9.1
    Updating miniz_oxide v0.7.2 -> v0.8.2
      Adding mio v1.0.3
    Removing mirai-annotations v1.12.0
    Updating native-tls v0.2.11 -> v0.2.12
      Adding nix v0.28.0 (latest: v0.29.0)
    Updating num-bigint v0.4.4 -> v0.4.6
    Updating num-iter v0.1.44 -> v0.1.45
    Updating num-traits v0.2.18 -> v0.2.19
    Removing num_cpus v1.16.0
    Updating object v0.32.2 -> v0.36.7
    Updating once_cell v1.19.0 -> v1.20.2
    Updating oorandom v11.1.3 -> v11.1.4
    Updating openssl v0.10.64 -> v0.10.68
    Updating openssl-src v300.2.3+3.2.1 -> v300.4.1+3.4.0
    Updating openssl-sys v0.9.101 -> v0.9.104
    Updating parking v2.2.0 -> v2.2.1
    Updating parking_lot v0.12.1 -> v0.12.3
    Updating parking_lot_core v0.9.9 -> v0.9.10
    Updating paste v1.0.14 -> v1.0.15
    Updating pin-project v1.1.5 -> v1.1.8
    Updating pin-project-internal v1.1.5 -> v1.1.8
    Updating pin-project-lite v0.2.13 -> v0.2.16
    Updating piper v0.2.1 -> v0.2.4
    Updating pkg-config v0.3.30 -> v0.3.31
    Updating plotters v0.3.5 -> v0.3.7
    Updating plotters-backend v0.3.5 -> v0.3.7
    Updating plotters-svg v0.3.5 -> v0.3.7
    Updating polling v3.5.0 -> v3.7.4
    Updating ppv-lite86 v0.2.17 -> v0.2.20
    Updating predicates v3.1.0 -> v3.1.3
    Updating predicates-core v1.0.6 -> v1.0.9
    Updating predicates-tree v1.0.9 -> v1.0.12
    Updating prettyplease v0.2.17 -> v0.2.27
    Updating proc-macro-crate v3.1.0 -> v3.2.0
    Updating proc-macro2 v1.0.89 -> v1.0.93
    Updating quote v1.0.35 -> v1.0.38
    Updating rayon v1.9.0 -> v1.10.0
    Updating redox_syscall v0.4.1 -> v0.5.8
    Updating redox_users v0.4.4 -> v0.4.6 (latest: v0.5.0)
    Updating regex v1.10.3 -> v1.11.1
    Updating regex-automata v0.4.6 -> v0.4.9
    Updating regex-syntax v0.8.2 -> v0.8.5
    Updating rkyv v0.7.44 -> v0.7.45 (latest: v0.8.9)
    Updating rkyv_derive v0.7.44 -> v0.7.45 (latest: v0.8.9)
    Updating rsa v0.9.6 -> v0.9.7
    Updating rust_decimal v1.34.3 -> v1.36.0
    Updating rustc-demangle v0.1.23 -> v0.1.24
    Removing rustix v0.37.27
    Removing rustix v0.38.31
      Adding rustix v0.37.28 (latest: v0.38.43)
      Adding rustix v0.38.43
    Updating rustls v0.23.11 -> v0.23.21
    Updating rustls-native-certs v0.8.0 -> v0.8.1
    Updating rustls-pemfile v2.1.2 -> v2.2.0
    Updating rustls-pki-types v1.7.0 -> v1.10.1
    Updating rustls-webpki v0.102.5 -> v0.102.8
    Updating rustversion v1.0.17 -> v1.0.19
    Updating ryu v1.0.17 -> v1.0.18
    Updating schannel v0.1.23 -> v0.1.27
    Removing security-framework v2.9.2
      Adding security-framework v2.11.1 (latest: v3.2.0)
      Adding security-framework v3.2.0
    Updating security-framework-sys v2.9.1 -> v2.14.0
    Updating semver v1.0.22 -> v1.0.24
    Updating serde v1.0.197 -> v1.0.217
    Updating serde_derive v1.0.197 -> v1.0.217
      Adding serde_fmt v1.0.3
    Updating serde_json v1.0.114 -> v1.0.135
      Adding serde_spanned v0.6.8
    Updating signal-hook-mio v0.2.3 -> v0.2.4
    Updating signal-hook-registry v1.4.1 -> v1.4.2
    Updating simdutf8 v0.1.4 -> v0.1.5
    Updating smallvec v1.13.1 -> v1.13.2
    Updating socket2 v0.5.6 -> v0.5.8
    Removing spin v0.5.2
    Updating stringprep v0.1.4 -> v0.1.5
    Removing strsim v0.10.0
    Removing strsim v0.11.0
      Adding strsim v0.11.1
    Updating subtle v2.5.0 -> v2.6.1
      Adding sval v2.13.2
      Adding sval_buffer v2.13.2
      Adding sval_dynamic v2.13.2
      Adding sval_fmt v2.13.2
      Adding sval_json v2.13.2
      Adding sval_nested v2.13.2
      Adding sval_ref v2.13.2
      Adding sval_serde v2.13.2
    Updating syn v2.0.87 -> v2.0.96
    Removing syn_derive v0.1.8
      Adding target-triple v0.1.3
    Updating tempfile v3.10.1 -> v3.15.0
    Updating termtree v0.4.1 -> v0.5.1
    Removing thiserror v1.0.58
    Removing thiserror v2.0.0
      Adding thiserror v1.0.69 (latest: v2.0.11)
      Adding thiserror v2.0.11
    Removing thiserror-impl v1.0.58
    Removing thiserror-impl v2.0.0
      Adding thiserror-impl v1.0.69 (latest: v2.0.11)
      Adding thiserror-impl v2.0.11
    Updating time v0.3.36 -> v0.3.37
    Updating time-macros v0.2.18 -> v0.2.19
    Updating tinyvec v1.6.0 -> v1.8.1
    Updating tokio v1.36.0 -> v1.43.0
    Updating tokio-macros v2.2.0 -> v2.5.0
    Updating tokio-stream v0.1.14 -> v0.1.17
      Adding toml v0.8.19
    Updating toml_datetime v0.6.6 -> v0.6.8
    Updating toml_edit v0.21.1 -> v0.22.22
    Updating tower-layer v0.3.2 -> v0.3.3
    Updating tower-service v0.3.2 -> v0.3.3
    Updating tracing v0.1.40 -> v0.1.41
    Updating tracing-attributes v0.1.27 -> v0.1.28
    Updating tracing-core v0.1.32 -> v0.1.33
    Updating trybuild v1.0.89 -> v1.0.101
      Adding typeid v1.0.2
    Updating unicode-bidi v0.3.15 -> v0.3.18
    Updating unicode-ident v1.0.12 -> v1.0.14
    Updating unicode-normalization v0.1.23 -> v0.1.24
      Adding unicode-properties v0.1.3
    Updating unicode-segmentation v1.11.0 -> v1.12.0
    Removing unicode-width v0.1.13
      Adding unicode-width v0.1.14 (latest: v0.2.0)
      Adding unicode-width v0.2.0
    Updating url v2.5.3 -> v2.5.4
    Updating utf8parse v0.2.1 -> v0.2.2
    Updating uuid v1.7.0 -> v1.11.1
    Updating value-bag v1.8.0 -> v1.10.0
      Adding value-bag-serde1 v1.10.0
      Adding value-bag-sval2 v1.10.0
    Updating version_check v0.9.4 -> v0.9.5
    Updating waker-fn v1.1.1 -> v1.2.0
    Updating wasm-bindgen v0.2.92 -> v0.2.99
    Updating wasm-bindgen-backend v0.2.92 -> v0.2.99
    Updating wasm-bindgen-futures v0.4.42 -> v0.4.49
    Updating wasm-bindgen-macro v0.2.92 -> v0.2.99
    Updating wasm-bindgen-macro-support v0.2.92 -> v0.2.99
    Updating wasm-bindgen-shared v0.2.92 -> v0.2.99
    Updating web-sys v0.3.69 -> v0.3.76
    Updating webpki-roots v0.26.3 -> v0.26.7
    Updating whoami v1.5.1 -> v1.5.2
    Updating winapi-util v0.1.6 -> v0.1.9
      Adding windows-sys v0.59.0
    Updating windows-targets v0.52.4 -> v0.52.6 (latest: v0.53.0)
    Updating windows_aarch64_gnullvm v0.52.4 -> v0.52.6 (latest: v0.53.0)
    Updating windows_aarch64_msvc v0.52.4 -> v0.52.6 (latest: v0.53.0)
    Updating windows_i686_gnu v0.52.4 -> v0.52.6 (latest: v0.53.0)
      Adding windows_i686_gnullvm v0.52.6 (latest: v0.53.0)
    Updating windows_i686_msvc v0.52.4 -> v0.52.6 (latest: v0.53.0)
    Updating windows_x86_64_gnu v0.52.4 -> v0.52.6 (latest: v0.53.0)
    Updating windows_x86_64_gnullvm v0.52.4 -> v0.52.6 (latest: v0.53.0)
    Updating windows_x86_64_msvc v0.52.4 -> v0.52.6 (latest: v0.53.0)
    Updating winnow v0.5.40 -> v0.6.24
    Updating yoke v0.7.4 -> v0.7.5
    Updating yoke-derive v0.7.4 -> v0.7.5
    Updating zerocopy v0.7.32 -> v0.7.35 (latest: v0.8.14)
    Updating zerocopy-derive v0.7.32 -> v0.7.35 (latest: v0.8.14)
    Updating zerofrom v0.1.4 -> v0.1.5
    Updating zerofrom-derive v0.1.4 -> v0.1.5
    Updating zeroize v1.7.0 -> v1.8.1
    Removing zeroize_derive v1.4.2
note: pass `--verbose` to see 88 unchanged dependencies behind latest
```
2025-01-13 14:44:52 -08:00
Karam Barakat
b386862ed5 Update row.rs
Row::get should track caller for a better development experience.
2025-01-13 05:57:25 -08:00
Paolo Barbolini
6b337668de
fix(cli): running tests on 32bit platforms (#3666) 2025-01-06 16:00:18 -08:00
Frank Elsinga
9d74aeae52
chore: issue forms with reason-listings (#3476)
* feat: added a draft of an issue form

* fixed a validation issue

* finished up the templates

* used austins phrasing

* Applied comments from the code review

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

* Applyed more suggestions from code review

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

* Broke the environment up into multiple fields

* boiled the FR-fields down to a description and an  breaking change field

* fixed an unique id issue

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2025-01-03 21:24:04 -08:00
Austin Bonander
28cfdbb40c
Release/0.8.3 (#3663)
* chore: create 0.8.3 release

* fix: prevent dead-branch warning from Clippy in query macros

cc #3595

* fix: move `#[allow]` from previous commit to the `if` block
2025-01-03 20:28:57 -08:00
joeydewaal
dfd0ac5974
feat: add Transaction type aliases (#3658) 2025-01-03 00:26:09 -08:00
Rinat Shigapov
4590b9c3ee
close listener connection on TimedOut and BrokenPipe errors (#3648)
* close listener connection on TimedOut and BrokerPipe errors

* use matches macro to generate jump table instead of chain of conditions
2024-12-24 17:00:40 -08:00
Jakub Łabor
fdd4663318 Add PgConnection::is_explain_available 2024-12-24 01:53:37 -08:00
Jakub Labor
20bccf8877 Dont use EXPLAIN in nullability check for QuestDB 2024-12-24 01:53:37 -08:00
Paolo Barbolini
7d148bd96b Bump hashbrown to v0.15 2024-12-24 01:52:20 -08:00
Paolo Barbolini
9f6ea96e03 Roll PostgreSQL 11..=15 tests to 13..=17 2024-12-19 19:12:16 -08:00
James H.
1678b19a46
feat: add geometry line (#3623)
* feat: add geometry line

* fix: point vs line

* fix: try regular comparison for line

* fix: undo point comparison change

* fix: regular comparison for array lines

* fix: remove line array test
2024-12-12 12:52:30 -08:00
Paolo Barbolini
2b82ce3faa Bump hashlink to v0.10 2024-12-12 12:43:39 -08:00
joeydewaal
1f6ce33df4
chore: remove BoxFuture's (non-breaking) (#3629)
* chore: reduce BoxFuture's when using recursion.

* remove BoxFuture's in WithSocket

* chore: better document previous changes
2024-12-12 12:43:22 -08:00
Philip Cristiano
42ce24dab8
Add support for Postgres lquery arrays (#3553)
An lquery array can be used with the `?` operator for "Does ltree match
any lquery in array?"

Documentation: https://www.postgresql.org/docs/current/ltree.html#LTREE-OPS-FUNCS

Closes #2246
2024-11-27 19:00:13 -08:00
Ilya Bizyaev
35c78f5175
Support building with rustls but native certificates (#3551)
This adds an alternative TLS configuration that relies on rustls-native-certs,
for users who cannot bundle the MPL-licensed webpki-roots.

The approach is copied from reqwest:

* https://github.com/seanmonstar/reqwest/blob/3ad6e02cd/Cargo.toml#L48
* https://github.com/seanmonstar/reqwest/blob/3ad6e02cd/src/async_impl/client.rs#L513

— except error handling is relaxed to accommodate for tls_config.root_cert_path.
2024-11-27 16:39:18 -08:00
Gabriel Lopes Veiga
3e140ba384
Derive Copy where possible (#3577)
For database-specific types.
2024-11-27 14:49:08 -08:00
Austin Bonander
35f3ec1944
fix(mysql): percent-decode database name (#3612)
Duplicates the fix to Postgres in #3593 to the MySQL driver.

The SQLite driver already does this: e3ef8baf23/sqlx-sqlite/src/options/parse.rs (L29-L32)
2024-11-27 14:45:46 -08:00
Lo
94607b5a10
parse timezone parameter in mysql connection url (#3418)
* feat(mysql): support configuring the timezone via url

* test: add test case for mysql with timezone

---------

Co-authored-by: lo <lo@los-MacBook-Pro.local>
2024-11-27 14:14:00 -08:00
Chris Hanks
4f10962743
Add PgListener::next_buffered(), to support batch processing of notifications (#3560)
* Implement and test PgListener::try_recv_buffered().

* rustfmt

* Fix warnings.

* Fix test.

* Rename try_recv_buffered() -> next_buffered().
2024-11-27 13:56:01 -08:00
Sean Lynch
503a72c94f
Eagerly reconnect in PgListener::try_recv (#3585)
When PgListener's underlying connection is closed, try_recv() will
return Ok(None) and reconnect on the next call. In this case, user code
is supposed to reload its state from the database (or otherwise handle
potentially missing messages). However, if the user code uses another
database connection to do so then there is a period between when the
state is reloaded and PgListener's connection is re-established where
notifications are lost without any indication that this has happened.

This commit changes PgListener to eagerly reconnect by default. At the
suggestion of @abonander on discord, I have also included an option to
switch back to the old behaviour in the case where someone was depending
on it.

Now, if the connection is closed then, by default, user code can do
whatever it needs to do in order to recover and any notifications
emitted in the meantime will be waiting for it when it is done.
2024-11-27 13:52:23 -08:00
XueHaonan
5c6623dee2
fix: fix example code of query_as (#3558)
query_as.rs: 230 mismatched bracket.
query_as.rs: 230 move TIMESTAMP to TIMESTAMPTZ to match type time::OffsetDateTime.
query_as.rs: 241, 251, 260 move i64 to i32 to match postgres type `INT4`.
2024-11-27 13:51:52 -08:00
Benoit Ranque
e3ef8baf23
URL decode database name when parsing connection url (#3593) 2024-11-27 13:48:34 -08:00
James H.
a7f2928a1b
feat(postgres): point (#3583)
* feat: point

* test: try if eq operator works for arrays of geometries

* fix: re-introduce comparison

* fix: test other geometry comparison

* test: geometry array equality check

* test: array match for geo arrays geo match for geo only

* fix: prepare geometric array type

* fix: update array comparison

* fix: try another method of geometric array comparison

* fix: one more geometry match tests

* fix: correct query syntax

* test: geometry test further
2024-11-27 13:35:42 -08:00
Paolo Barbolini
3e8952b0d4
Bump thiserror to v2.0.0 (#3596) 2024-11-26 11:01:33 -08:00
Henri Sivonen
4fac945d5a
Remove default-features = false from url (#3601)
Fixes #3589.
2024-11-26 11:01:18 -08:00
Andrew Eggleston
8dfd3e0bc6
Fix mistake in sqlx::test fixtures docs (#3604)
Alternative option for the sqlx::test fixtures referenced the same fixture twice
2024-11-26 11:00:05 -08:00
Jakub Łabor
80314609ac
Use UNION ALL instead of UNION in nullable check (#3605) 2024-11-26 10:59:47 -08:00
Pmarquez
d4ae6ffd88
Implement AnyQueryResult for Sqlite and MySQL (#3608)
* impl AnyQueryResult for Sqlite and MySQL

* fix MySQL AnyQueryResult

* fix MySQL AnyQueryResult

* fix manifest

* rewrite `use` and address implementation concerns
2024-11-26 10:59:20 -08:00
Austin Bonander
82d332f4b4
doc(mysql): document difference between Uuid and uuid::fmt::Hyphenated (#3580) 2024-10-28 16:39:43 -07:00
Quentin Gliech
709226c19d
Implement Acquire for PgListener (#3550)
* Implement Acquire for PgListener

* Add a test which checks that PgListener implements Acquire

* Drop unnecessary call to `.acquire()`

* Rename test channel to avoid conflict with other tests
2024-10-28 15:00:06 -07:00
Oleksandr Babak
eac4b7aff7
Fix: Cannot query Postgres INTERVAL[] (#3566)
* fix(sqlx-postgres): macro could not understand pg interval array type

* refactor(sqlx-postgres): move pg interval array types closer to other array types
2024-10-28 14:59:41 -07:00
Joris Willems
3fb00e1403
Reexport AnyTypeKind (#3579) 2024-10-28 14:59:18 -07:00
Dennis Schubert
028084bce3
Demote .pgpass file warning to a debug message. (#3548)
Fixes #3531
2024-10-06 15:21:56 -07:00
Trevor
cadf152e99
fix: remove sqlformat (#3545)
* removed sqlformat from sql-core/src/logger.rs causing ref error to FormatOptions

* removed sqlformat from sql-core/src/logger.rs causing ref error to FormatOptions

---------

Co-authored-by: tbarnes <tbarnes@tbserver.tbarnes-server.local>
2024-10-04 21:34:18 -07:00
Andrei Nesterov
19f40d87a6
Obey no-transaction flag in down migrations (#3528) 2024-10-02 15:32:30 -07:00
joeydewaal
72512f7311
Support PgHstore by default in macros (#3514)
* Support PgHstore in macros

* Change tests

* Remove unused import
2024-10-02 11:56:13 -07:00
依云
5b8bb3b28b
Add a "sqlite-unbundled" feature that dynamically links to system libsqlite3.so library (#3507)
* Add a "sqlite-unbundled" feature that dynamically links to system libsqlite3.so library

* update README abouot the newly-added `sqlite-unbundled` feature

* Update README.md to make it clear with bulleted list

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

* more cfg feature updates

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

* update documentation in sqlx-sqlx/src/lib.rs too

and also mention possible build time increasement.

* cargo fmt

* Add "sqlite-unbundled" feature to sqlx-cli

* Add sqlite-unbundled to gituhb actions tests

* cfg(feature = "sqlite") => cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))

* fix

* CI: make sqlite-unbundled tests workaround required-features

by duplicating the relevant test section

* use an internal "_sqlite" feature to do the conditional compilation

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2024-10-02 11:55:21 -07:00
joeydewaal
68da5aefea
Box Pgconnection fields (#3529)
* Update PgConnection code

* rustfmt
2024-10-02 11:42:54 -07:00
Joey de Waal
81298b86b3 add regression test 2024-10-02 11:42:33 -07:00
Joey de Waal
e62bbd7ee9 Change test macro error message 2024-10-02 11:42:33 -07:00
Joey de Waal
ef039c5d67 recursively look for literal in test macro 2024-10-02 11:42:33 -07:00
vsuryamurthy
293c55ce89 Remove unused dependencies from sqlx-core, sqlx-cli and sqlx-postgres 2024-09-24 18:46:31 -07:00
Simon Brüggen
a496413cb6
doc(sqlite): show how to turn options into a pool (#3508)
It took me 15 minutes of messing around and googling to find
`.connect_with()`.
2024-09-15 21:38:00 -07:00
Austin Bonander
2f5ba71c1e
chore(mysql): create test for passwordless auth (#3484) (#3505)
This isn't a solution for #3484, as that seems to be an issue with privileges on the user's side. However, in the process of figuring that out, I realized we never explicitly test password-less auth.
2024-09-14 11:51:22 -07:00
Austin Bonander
dc32f99c0f
doc(README): more prominent link for Discord 2024-09-13 11:49:56 -07:00
gridbox
daeb87bef1
Add sqlite commit and rollback hooks (#3500)
* fix: Derive clone for SqliteOperation

* feat: Add sqlite commit and rollback hooks

---------

Co-authored-by: John Smith <asserta4@gmail.com>
2024-09-12 11:57:02 -07:00