Commit Graph

1735 Commits

Author SHA1 Message Date
Thorsten Ball
fc4c533d0a
zed: Use CLI env for lang servers, tasks, terminal (#17075)
This changes the Zed CLI `zed` to pass along the environment to the Zed
project that it opens (if it opens a new one).

In projects, this CLI environment will now take precedence over any
environment that's acquired by running a login shell in a projects
folder.

The result is that `zed my/folder` now always behaves as if one would
run `zed --foreground` without any previous Zed version running.


Closes #7894
Closes #16293 

Related issues:
- It fixes the issue described in here:
https://github.com/zed-industries/zed/issues/4977#issuecomment-2305272027


Release Notes:

- Improved the Zed CLI `zed` to pass along the environment as it was on
the CLI to the opened Zed project. That environment is then used when
opening new terminals, spawning tasks, or language servers.
Specifically:
- If Zed was started via `zed my-folder`, a terminal spawned with
`workspace: new terminal` will inherit these environment variables that
existed on the CLI
- Specific language servers that allow looking up the language server
binary in the environments `$PATH` (such as `gopls`, `zls`,
`rust-analyzer` if configured, ...) will look up the language server
binary in the CLI environment too and use that environment when starting
the process.
- Language servers that are _not_ found in the CLI environment (or
configured to not be found in there), will be spawned with the CLI
environment in case that's set. That means users can do something like
`RA_LOG=info zed .` and it will be picked up the rust-analyzer that was
spawned.

Demo/explanation:



https://github.com/user-attachments/assets/455905cc-8b7c-4fc4-b98a-7e027d97cdfa
2024-08-29 18:09:06 +02:00
Marshall Bowers
4f408ec65a
collab: Record geoip_country_code on HTTP request spans (#17092)
This PR attaches the `geoip_country_code` that we source from
Cloudflare's `CF-IPCountry` header to the HTTP request spans.

This will allow us to see where traffic is originating geographically.

Release Notes:

- N/A
2024-08-29 11:33:51 -04:00
Peter Tripp
4d6bb52d1f
Anthropic/OpenAI: Add country codes for territories (#17089)
- Cloudflare provides ISO-3166-1 country code for protectorates. Expand our allowlist to include the territories of countries on the allowlist (US, UK, France, Australia, New Zealand). 
- Also include the country_code in the error message when we block. 

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-29 11:32:29 -04:00
Marshall Bowers
d666cc5fba
collab: Report when upstream rate limit is exceeded (#17083)
This PR makes it so we report a trace when the upstream rate limit is
exceeded.

Release Notes:

- N/A
2024-08-29 08:54:45 -04:00
renovate[bot]
760e1a6db0
Update Rust crate sqlx to 0.8 [SECURITY] (#16791)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [sqlx](https://togithub.com/launchbadge/sqlx) | dev-dependencies |
minor | `0.7` -> `0.8` |
| [sqlx](https://togithub.com/launchbadge/sqlx) | dependencies | minor |
`0.7` -> `0.8` |

### GitHub Vulnerability Alerts

####
[GHSA-xmrp-424f-vfpx](https://togithub.com/launchbadge/sqlx/issues/3440)

The following presentation at this year's DEF CON was brought to our
attention on the SQLx Discord:

> SQL Injection isn't Dead: Smuggling Queries at the Protocol Level  
>
<http://web.archive.org/web/20240812130923/https://media.defcon.org/DEF%20CON%2032/DEF%20CON%2032%20presentations/DEF%20CON%2032%20-%20Paul%20Gerste%20-%20SQL%20Injection%20Isn't%20Dead%20Smuggling%20Queries%20at%20the%20Protocol%20Level.pdf>
> (Archive link for posterity.)

Essentially, encoding a value larger than 4GiB can cause the length
prefix in the protocol to overflow,
causing the server to interpret the rest of the string as binary
protocol commands or other data.

It appears SQLx _does_ perform truncating casts in a way that could be
problematic,
for example:
<6f2905695b/sqlx-postgres/src/arguments.rs (L163)>

This code has existed essentially since the beginning, 
so it is reasonable to assume that all published versions `<= 0.8.0` are
affected.

## Mitigation

As always, you should make sure your application is validating
untrustworthy user input.
Reject any input over 4 GiB, or any input that could _encode_ to a
string longer than 4 GiB.
Dynamically built queries are also potentially problematic if it pushes
the message size over this 4 GiB bound.


[`Encode::size_hint()`](https://docs.rs/sqlx/latest/sqlx/trait.Encode.html#method.size_hint)
can be used for sanity checks, but do not assume that the size returned
is accurate.
For example, the `Json<T>` and `Text<T>` adapters have no reasonable way
to predict or estimate the final encoded size,
so they just return `size_of::<T>()` instead.

For web application backends, consider adding some middleware that
limits the size of request bodies by default.

## Resolution

Work has started on a branch to add `#[deny]` directives for the
following Clippy lints:

*
[`cast_possible_truncation`](https://rust-lang.github.io/rust-clippy/master/#/cast_possible_truncation)
*
[`cast_possible_wrap`](https://rust-lang.github.io/rust-clippy/master/#/cast_possible_wrap)
*
[`cast_sign_loss`](https://rust-lang.github.io/rust-clippy/master/#/cast_sign_loss)

and to manually audit the code that they flag.

A fix is expected to be included in the `0.8.1` release (still WIP as of
writing).

---

### Release Notes

<details>
<summary>launchbadge/sqlx (sqlx)</summary>

###
[`v0.8.1`](https://togithub.com/launchbadge/sqlx/blob/HEAD/CHANGELOG.md#081---2024-08-23)

[Compare
Source](https://togithub.com/launchbadge/sqlx/compare/v0.8.0...v0.8.1)

16 pull requests were merged this release cycle.

This release contains a fix for [RUSTSEC-2024-0363].

Postgres users are advised to upgrade ASAP as a possible exploit has
been demonstrated:
[#&#8203;3440
(comment)](https://togithub.com/launchbadge/sqlx/issues/3440#issuecomment-2307956901)

MySQL and SQLite do not *appear* to be exploitable, but upgrading is
recommended nonetheless.

##### Added

- \[[#&#8203;3421]]: correct spelling of
`MySqlConnectOptions::no_engine_substitution()`
\[\[[@&#8203;kolinfluence](https://togithub.com/kolinfluence)]]
- Deprecates `MySqlConnectOptions::no_engine_subsitution()` (oops) in
favor of the correctly spelled version.

##### Changed

- \[[#&#8203;3376]]: doc: hide `spec_error` module
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- This is a helper module for the macros and was not meant to be
exposed.
- It is not expected to receive any breaking changes for the 0.8.x
release, but is not designed as a public API.
        Use at your own risk.
- \[[#&#8203;3382]]: feat: bumped to `libsqlite3-sys=0.30.1` to support
sqlite 3.46
\[\[[@&#8203;CommanderStorm](https://togithub.com/CommanderStorm)]]
- \[[#&#8203;3385]]: chore(examples):Migrated the pg-chat example to
ratatui
\[\[[@&#8203;CommanderStorm](https://togithub.com/CommanderStorm)]]
- \[[#&#8203;3399]]: Upgrade to rustls 0.23
\[\[[@&#8203;djc](https://togithub.com/djc)]]
- RusTLS now has pluggable cryptography providers: `ring` (the existing
implementation),
        and `aws-lc-rs` which has optional FIPS certification.
- The existing features activating RusTLS (`runtime-tokio-rustls`,
`runtime-async-std-rustls`, `tls-rustls`)
enable the `ring` provider of RusTLS to match the existing behavior so
this *should not* be a breaking change.
- Switch to the `tls-rustls-aws-lc-rs` feature to use the `aws-lc-rs`
provider.
- If using `runtime-tokio-rustls` or `runtime-async-std-rustls`,
this will necessitate switching to the appropriate non-legacy runtime
feature:
            `runtime-tokio` or `runtime-async-std`
- See the RusTLS README for more details:
<https://github.com/rustls/rustls?tab=readme-ov-file#cryptography-providers>

##### Fixed

- \[[#&#8203;2786]]: fix(sqlx-cli): do not clean sqlx during prepare
\[\[[@&#8203;cycraig](https://togithub.com/cycraig)]]
- \[[#&#8203;3354]]: sqlite: fix inconsistent read-after-write
\[\[[@&#8203;ckampfe](https://togithub.com/ckampfe)]]
- \[[#&#8203;3371]]: Fix encoding and decoding of MySQL enums in
`sqlx::Type` \[\[[@&#8203;alu](https://togithub.com/alu)]]
- \[[#&#8203;3374]]: fix: usage of `node12` in `SQLx` action
\[\[[@&#8203;hamirmahal](https://togithub.com/hamirmahal)]]
- \[[#&#8203;3380]]: chore: replace structopt with clap in examples
\[\[[@&#8203;tottoto](https://togithub.com/tottoto)]]
- \[[#&#8203;3381]]: Fix CI after Rust 1.80, remove dead feature
references \[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3384]]: chore(tests): fixed deprecation warnings
\[\[[@&#8203;CommanderStorm](https://togithub.com/CommanderStorm)]]
- \[[#&#8203;3386]]: fix(dependencys):bumped cargo_metadata to `v0.18.1`
to avoid yanked `v0.14.3`
\[\[[@&#8203;CommanderStorm](https://togithub.com/CommanderStorm)]]
- \[[#&#8203;3389]]: fix(cli): typo in error for required DB URL
\[\[[@&#8203;ods](https://togithub.com/ods)]]
- \[[#&#8203;3417]]: Update version to 0.8 in README
\[\[[@&#8203;soucosmo](https://togithub.com/soucosmo)]]
- \[[#&#8203;3441]]: fix: audit protocol handling
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- This addresses [RUSTSEC-2024-0363] and includes regression tests for
MySQL, Postgres and SQLite.

[#&#8203;2786]: https://togithub.com/launchbadge/sqlx/pull/2786

[#&#8203;3354]: https://togithub.com/launchbadge/sqlx/pull/3354

[#&#8203;3371]: https://togithub.com/launchbadge/sqlx/pull/3371

[#&#8203;3374]: https://togithub.com/launchbadge/sqlx/pull/3374

[#&#8203;3376]: https://togithub.com/launchbadge/sqlx/pull/3376

[#&#8203;3380]: https://togithub.com/launchbadge/sqlx/pull/3380

[#&#8203;3381]: https://togithub.com/launchbadge/sqlx/pull/3381

[#&#8203;3382]: https://togithub.com/launchbadge/sqlx/pull/3382

[#&#8203;3384]: https://togithub.com/launchbadge/sqlx/pull/3384

[#&#8203;3385]: https://togithub.com/launchbadge/sqlx/pull/3385

[#&#8203;3386]: https://togithub.com/launchbadge/sqlx/pull/3386

[#&#8203;3389]: https://togithub.com/launchbadge/sqlx/pull/3389

[#&#8203;3399]: https://togithub.com/launchbadge/sqlx/pull/3399

[#&#8203;3417]: https://togithub.com/launchbadge/sqlx/pull/3417

[#&#8203;3421]: https://togithub.com/launchbadge/sqlx/pull/3421

[#&#8203;3441]: https://togithub.com/launchbadge/sqlx/pull/3441

[RUSTSEC-2024-0363]:
https://rustsec.org/advisories/RUSTSEC-2024-0363.html

###
[`v0.8.0`](https://togithub.com/launchbadge/sqlx/blob/HEAD/CHANGELOG.md#080---2024-07-22)

[Compare
Source](https://togithub.com/launchbadge/sqlx/compare/v0.7.4...v0.8.0)

70 pull requests were merged this release cycle.

[#&#8203;2697] was merged the same day as release 0.7.4 and so was
missed by the automatic CHANGELOG generation.

##### Breaking

- \[[#&#8203;2697]]: fix(macros): only enable chrono when time is
disabled
\[\[[@&#8203;saiintbrisson](https://togithub.com/saiintbrisson)]]
- \[[#&#8203;2973]]: Generic Associated Types in Database, replacing
HasValueRef, HasArguments, HasStatement
\[\[[@&#8203;nitn3lav](https://togithub.com/nitn3lav)]]
- \[[#&#8203;2482]]: chore: bump syn to 2.0
\[\[[@&#8203;saiintbrisson](https://togithub.com/saiintbrisson)]]
- Deprecated type ascription syntax in the query macros was removed.
- \[[#&#8203;2736]]: Fix describe on PostgreSQL views with rules
\[\[[@&#8203;tsing](https://togithub.com/tsing)]]
- Potentially breaking: nullability inference changes for Postgres.
- \[[#&#8203;2869]]: Implement PgHasArrayType for all references
\[\[[@&#8203;tylerhawkes](https://togithub.com/tylerhawkes)]]
    -   Conflicts with existing manual implementations.
- \[[#&#8203;2940]]: fix: Decode and Encode derives
([#&#8203;1031](https://togithub.com/launchbadge/sqlx/issues/1031))
\[\[[@&#8203;benluelo](https://togithub.com/benluelo)]]
    -   Changes lifetime obligations for field types.
- \[[#&#8203;3064]]: Sqlite explain graph
\[\[[@&#8203;tyrelr](https://togithub.com/tyrelr)]]
    -   Potentially breaking: nullability inference changes for SQLite.
- \[[#&#8203;3123]]: Reorder attrs in sqlx::test macro
\[\[[@&#8203;bobozaur](https://togithub.com/bobozaur)]]
- Potentially breaking: attributes on `#[sqlx::test]` usages are applied
in the correct order now.
- \[[#&#8203;3126]]: Make Encode return a result
\[\[[@&#8203;FSMaxB](https://togithub.com/FSMaxB)]]
- \[[#&#8203;3130]]: Add version information for failed cli migration
([#&#8203;3129](https://togithub.com/launchbadge/sqlx/issues/3129))
\[\[[@&#8203;FlakM](https://togithub.com/FlakM)]]
    -   Breaking changes to `MigrateError`.
- \[[#&#8203;3181]]: feat: no tx migration
\[\[[@&#8203;cleverjam](https://togithub.com/cleverjam)]]
- (Postgres only) migrations that should not run in a transaction can be
flagged by adding `-- no-transaction` to the beginning.
    -   Breaking change: added field to `Migration`
- \[[#&#8203;3184]]: \[BREAKING} fix(sqlite): always use `i64` as
intermediate when decoding
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- 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.
- \[[#&#8203;3252]]: fix `#[derive(sqlx::Type)]` in Postgres
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- Manual implementations of PgHasArrayType for enums will conflict with
the generated one. Delete the manual impl or add `#[sqlx(no_pg_array)]`
where conflicts occur.
    -   Type equality for PgTypeInfo is now schema-aware.
- \[[#&#8203;3329]]: fix: correct handling of arrays of custom types in
Postgres \[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- Potential breaking change: `PgTypeInfo::with_name()` infers types that
start with `_` to be arrays of the un-prefixed type. Wrap type names in
quotes to bypass this behavior.
- \[[#&#8203;3356]]: breaking: fix name collision in `FromRow`, return
`Error::ColumnDecode` for `TryFrom` errors
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- Breaking behavior change: errors with `#[sqlx(try_from = "T")]` now
return `Error::ColumnDecode` instead of `Error::ColumnNotFound`.
- Breaking because `#[sqlx(default)]` on an individual field or the
struct itself would have previously suppressed the error.
This doesn't seem like good behavior as it could result in some
potentially very difficult bugs.
- Instead, create a wrapper implementing `From` and apply the default
explicitly.
- \[[#&#8203;3337]]: allow rename with rename_all (close
[#&#8203;2896](https://togithub.com/launchbadge/sqlx/issues/2896))
\[\[[@&#8203;DirectorX](https://togithub.com/DirectorX)]]
- Changes the precedence of `#[sqlx(rename)]` and `#[sqlx(rename_all)]`
to match the expected behavior (`rename` wins).
- \[[#&#8203;3285]]: fix: use correct names for sslmode options
\[\[[@&#8203;lily-mosquitoes](https://togithub.com/lily-mosquitoes)]]
- Changes the output of `ConnectOptions::to_url_lossy()` to match what
parsing expects.

##### Added

- \[[#&#8203;2917]]: Add Debug impl for PgRow
\[\[[@&#8203;g-bartoszek](https://togithub.com/g-bartoszek)]]
- \[[#&#8203;3113]]: feat: new derive feature flag
\[\[[@&#8203;saiintbrisson](https://togithub.com/saiintbrisson)]]
- \[[#&#8203;3154]]: feat: add `MySqlTime`, audit `mysql::types` for
panics \[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3188]]: feat(cube): support postgres cube
\[\[[@&#8203;jayy-lmao](https://togithub.com/jayy-lmao)]]
- \[[#&#8203;3244]]: feat: support `NonZero*` scalar types
\[\[[@&#8203;AlphaKeks](https://togithub.com/AlphaKeks)]]
- \[[#&#8203;3260]]: feat: Add set_update_hook on SqliteConnection
\[\[[@&#8203;gridbox](https://togithub.com/gridbox)]]
- \[[#&#8203;3291]]: feat: support the Postgres Bool type for the Any
driver \[\[[@&#8203;etorreborre](https://togithub.com/etorreborre)]]
- \[[#&#8203;3293]]: Add LICENSE-\* files to crates
\[\[[@&#8203;LecrisUT](https://togithub.com/LecrisUT)]]
- \[[#&#8203;3303]]: add array support for NonZeroI\* in postgres
\[\[[@&#8203;JohannesIBK](https://togithub.com/JohannesIBK)]]
- \[[#&#8203;3311]]: Add example on how to use Transaction as Executor
\[\[[@&#8203;Lachstec](https://togithub.com/Lachstec)]]
- \[[#&#8203;3343]]: Add support for PostgreSQL HSTORE data type
\[\[[@&#8203;KobusEllis](https://togithub.com/KobusEllis)]]

##### Changed

- \[[#&#8203;2652]]: MySQL: Remove collation compatibility check for
strings \[\[[@&#8203;alu](https://togithub.com/alu)]]
- \[[#&#8203;2960]]: Removed `Send` trait bound from argument binding
\[\[[@&#8203;bobozaur](https://togithub.com/bobozaur)]]
- \[[#&#8203;2970]]: refactor: lift type mappings into driver crates
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3148]]: Bump libsqlite3-sys to v0.28
\[\[[@&#8203;NfNitLoop](https://togithub.com/NfNitLoop)]]
- Note: version bumps to `libsqlite3-sys` are not considered breaking
changes as per our semver guarantees.
- \[[#&#8203;3265]]: perf: box `MySqlConnection` to reduce sizes of
futures
\[\[[@&#8203;stepantubanov](https://togithub.com/stepantubanov)]]
- \[[#&#8203;3352]]: chore:added a testcase for `sqlx migrate add ...`
\[\[[@&#8203;CommanderStorm](https://togithub.com/CommanderStorm)]]
- \[[#&#8203;3340]]: ci: Add job to check that sqlx builds with its
declared minimum dependencies
\[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]

##### Fixed

- \[[#&#8203;2702]]: Constrain cyclic associated types to themselves
\[\[[@&#8203;BadBastion](https://togithub.com/BadBastion)]]
- \[[#&#8203;2954]]: Fix several inter doc links
\[\[[@&#8203;ralpha](https://togithub.com/ralpha)]]
- \[[#&#8203;3073]]: feat(logging): Log slow acquires from connection
pool \[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]
- \[[#&#8203;3137]]: SqliteConnectOptions::filename() memory fix
([#&#8203;3136](https://togithub.com/launchbadge/sqlx/issues/3136))
\[\[[@&#8203;hoxxep](https://togithub.com/hoxxep)]]
- \[[#&#8203;3138]]: PostgreSQL Bugfix: Ensure connection is usable
after failed COPY inside a transaction
\[\[[@&#8203;feikesteenbergen](https://togithub.com/feikesteenbergen)]]
- \[[#&#8203;3146]]: fix(sqlite): delete unused `ConnectionHandleRaw`
type \[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3162]]: Drop urlencoding dependency
\[\[[@&#8203;paolobarbolini](https://togithub.com/paolobarbolini)]]
- \[[#&#8203;3165]]: Bump deps that do not need code changes
\[\[[@&#8203;GnomedDev](https://togithub.com/GnomedDev)]]
- \[[#&#8203;3167]]: fix(ci): use `docker compose` instead of
`docker-compose`
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3172]]: fix: Option decoding in any driver
\[\[[@&#8203;pxp9](https://togithub.com/pxp9)]]
- \[[#&#8203;3173]]: fix(postgres) : int type conversion while decoding
\[\[[@&#8203;RaghavRox](https://togithub.com/RaghavRox)]]
- \[[#&#8203;3190]]: Update time to 0.3.36
\[\[[@&#8203;BlackSoulHub](https://togithub.com/BlackSoulHub)]]
- \[[#&#8203;3191]]: Fix unclean TLS shutdown
\[\[[@&#8203;levkk](https://togithub.com/levkk)]]
- \[[#&#8203;3194]]: Fix leaking connections in fetch_optional
([#&#8203;2647](https://togithub.com/launchbadge/sqlx/issues/2647))
\[\[[@&#8203;danjpgriffin](https://togithub.com/danjpgriffin)]]
- \[[#&#8203;3216]]: security: bump rustls to 0.21.11
\[\[[@&#8203;toxeus](https://togithub.com/toxeus)]]
- \[[#&#8203;3230]]: fix: sqlite pragma order for auto_vacuum
\[\[[@&#8203;jasonish](https://togithub.com/jasonish)]]
- \[[#&#8203;3233]]: fix: get_filename should not consume self
\[\[[@&#8203;jasonish](https://togithub.com/jasonish)]]
- \[[#&#8203;3234]]: fix(ci): pin Rust version, ditch unmaintained
actions \[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3236]]: fix: resolve `path` ownership problems when using
`sqlx_macros_unstable`
\[\[[@&#8203;lily-mosquitoes](https://togithub.com/lily-mosquitoes)]]
- \[[#&#8203;3254]]: fix: hide `sqlx_postgres::any`
\[\[[@&#8203;Zarathustra2](https://togithub.com/Zarathustra2)]]
- \[[#&#8203;3266]]: ci: MariaDB - add back 11.4 and add 11.5
\[\[[@&#8203;grooverdan](https://togithub.com/grooverdan)]]
- \[[#&#8203;3267]]: ci: syntax fix
\[\[[@&#8203;grooverdan](https://togithub.com/grooverdan)]]
- \[[#&#8203;3271]]: docs(sqlite): fix typo - unixtime() -> unixepoch()
\[\[[@&#8203;joelkoen](https://togithub.com/joelkoen)]]
- \[[#&#8203;3276]]: Invert boolean for `migrate` error message.
([#&#8203;3275](https://togithub.com/launchbadge/sqlx/issues/3275))
\[\[[@&#8203;nk9](https://togithub.com/nk9)]]
- \[[#&#8203;3279]]: fix Clippy errors
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3288]]: fix: sqlite update_hook char types
\[\[[@&#8203;jasonish](https://togithub.com/jasonish)]]
- \[[#&#8203;3297]]: Pass the `persistent` query setting when preparing
queries with the `Any` driver
\[\[[@&#8203;etorreborre](https://togithub.com/etorreborre)]]
- \[[#&#8203;3298]]: Track null arguments in order to provide the
appropriate type when converting them.
\[\[[@&#8203;etorreborre](https://togithub.com/etorreborre)]]
- \[[#&#8203;3312]]: doc: Minor rust docs fixes
\[\[[@&#8203;SrGesus](https://togithub.com/SrGesus)]]
- \[[#&#8203;3327]]: chore: fixed one usage of `select_input_type!()`
being unhygenic
\[\[[@&#8203;CommanderStorm](https://togithub.com/CommanderStorm)]]
- \[[#&#8203;3328]]: fix(ci): comment not separated from other
characters \[\[[@&#8203;hamirmahal](https://togithub.com/hamirmahal)]]
- \[[#&#8203;3341]]: refactor: Resolve cargo check warnings in postgres
examples \[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]
- \[[#&#8203;3346]]: fix(postgres): don't panic if `M` or `C` Notice
fields are not UTF-8
\[\[[@&#8203;YgorSouza](https://togithub.com/YgorSouza)]]
- \[[#&#8203;3350]]: fix:the `json`-feature should activate
`sqlx-postgres?/json` as well
\[\[[@&#8203;CommanderStorm](https://togithub.com/CommanderStorm)]]
- \[[#&#8203;3353]]: fix: build script new line at eof
\[\[[@&#8203;Zarthus](https://togithub.com/Zarthus)]]
- (no PR): activate `clock` and `std` features of
`workspace.dependencies.chrono`.

[#&#8203;2482]: https://togithub.com/launchbadge/sqlx/pull/2482

[#&#8203;2652]: https://togithub.com/launchbadge/sqlx/pull/2652

[#&#8203;2697]: https://togithub.com/launchbadge/sqlx/pull/2697

[#&#8203;2702]: https://togithub.com/launchbadge/sqlx/pull/2702

[#&#8203;2736]: https://togithub.com/launchbadge/sqlx/pull/2736

[#&#8203;2869]: https://togithub.com/launchbadge/sqlx/pull/2869

[#&#8203;2917]: https://togithub.com/launchbadge/sqlx/pull/2917

[#&#8203;2940]: https://togithub.com/launchbadge/sqlx/pull/2940

[#&#8203;2954]: https://togithub.com/launchbadge/sqlx/pull/2954

[#&#8203;2960]: https://togithub.com/launchbadge/sqlx/pull/2960

[#&#8203;2970]: https://togithub.com/launchbadge/sqlx/pull/2970

[#&#8203;2973]: https://togithub.com/launchbadge/sqlx/pull/2973

[#&#8203;3064]: https://togithub.com/launchbadge/sqlx/pull/3064

[#&#8203;3073]: https://togithub.com/launchbadge/sqlx/pull/3073

[#&#8203;3113]: https://togithub.com/launchbadge/sqlx/pull/3113

[#&#8203;3123]: https://togithub.com/launchbadge/sqlx/pull/3123

[#&#8203;3126]: https://togithub.com/launchbadge/sqlx/pull/3126

[#&#8203;3130]: https://togithub.com/launchbadge/sqlx/pull/3130

[#&#8203;3137]: https://togithub.com/launchbadge/sqlx/pull/3137

[#&#8203;3138]: https://togithub.com/launchbadge/sqlx/pull/3138

[#&#8203;3146]: https://togithub.com/launchbadge/sqlx/pull/3146

[#&#8203;3148]: https://togithub.com/launchbadge/sqlx/pull/3148

[#&#8203;3154]: https://togithub.com/launchbadge/sqlx/pull/3154

[#&#8203;3162]: https://togithub.com/launchbadge/sqlx/pull/3162

[#&#8203;3165]: https://togithub.com/launchbadge/sqlx/pull/3165

[#&#8203;3167]: https://togithub.com/launchbadge/sqlx/pull/3167

[#&#8203;3172]: https://togithub.com/launchbadge/sqlx/pull/3172

[#&#8203;3173]: https://togithub.com/launchbadge/sqlx/pull/3173

[#&#8203;3181]: https://togithub.com/launchbadge/sqlx/pull/3181

[#&#8203;3184]: https://togithub.com/launchbadge/sqlx/pull/3184

[#&#8203;3188]: https://togithub.com/launchbadge/sqlx/pull/3188

[#&#8203;3190]: https://togithub.com/launchbadge/sqlx/pull/3190

[#&#8203;3191]: https://togithub.com/launchbadge/sqlx/pull/3191

[#&#8203;3194]: https://togithub.com/launchbadge/sqlx/pull/3194

[#&#8203;3216]: https://togithub.com/launchbadge/sqlx/pull/3216

[#&#8203;3230]: https://togithub.com/launchbadge/sqlx/pull/3230

[#&#8203;3233]: https://togithub.com/launchbadge/sqlx/pull/3233

[#&#8203;3234]: https://togithub.com/launchbadge/sqlx/pull/3234

[#&#8203;3236]: https://togithub.com/launchbadge/sqlx/pull/3236

[#&#8203;3244]: https://togithub.com/launchbadge/sqlx/pull/3244

[#&#8203;3252]: https://togithub.com/launchbadge/sqlx/pull/3252

[#&#8203;3254]: https://togithub.com/launchbadge/sqlx/pull/3254

[#&#8203;3260]: https://togithub.com/launchbadge/sqlx/pull/3260

[#&#8203;3265]: https://togithub.com/launchbadge/sqlx/pull/3265

[#&#8203;3266]: https://togithub.com/launchbadge/sqlx/pull/3266

[#&#8203;3267]: https://togithub.com/launchbadge/sqlx/pull/3267

[#&#8203;3271]: https://togithub.com/launchbadge/sqlx/pull/3271

[#&#8203;3276]: https://togithub.com/launchbadge/sqlx/pull/3276

[#&#8203;3279]: https://togithub.com/launchbadge/sqlx/pull/3279

[#&#8203;3285]: https://togithub.com/launchbadge/sqlx/pull/3285

[#&#8203;3288]: https://togithub.com/launchbadge/sqlx/pull/3288

[#&#8203;3291]: https://togithub.com/launchbadge/sqlx/pull/3291

[#&#8203;3293]: https://togithub.com/launchbadge/sqlx/pull/3293

[#&#8203;3297]: https://togithub.com/launchbadge/sqlx/pull/3297

[#&#8203;3298]: https://togithub.com/launchbadge/sqlx/pull/3298

[#&#8203;3303]: https://togithub.com/launchbadge/sqlx/pull/3303

[#&#8203;3311]: https://togithub.com/launchbadge/sqlx/pull/3311

[#&#8203;3312]: https://togithub.com/launchbadge/sqlx/pull/3312

[#&#8203;3327]: https://togithub.com/launchbadge/sqlx/pull/3327

[#&#8203;3328]: https://togithub.com/launchbadge/sqlx/pull/3328

[#&#8203;3329]: https://togithub.com/launchbadge/sqlx/pull/3329

[#&#8203;3337]: https://togithub.com/launchbadge/sqlx/pull/3337

[#&#8203;3340]: https://togithub.com/launchbadge/sqlx/pull/3340

[#&#8203;3341]: https://togithub.com/launchbadge/sqlx/pull/3341

[#&#8203;3343]: https://togithub.com/launchbadge/sqlx/pull/3343

[#&#8203;3346]: https://togithub.com/launchbadge/sqlx/pull/3346

[#&#8203;3350]: https://togithub.com/launchbadge/sqlx/pull/3350

[#&#8203;3352]: https://togithub.com/launchbadge/sqlx/pull/3352

[#&#8203;3353]: https://togithub.com/launchbadge/sqlx/pull/3353

[#&#8203;3356]: https://togithub.com/launchbadge/sqlx/pull/3356

###
[`v0.7.4`](https://togithub.com/launchbadge/sqlx/blob/HEAD/CHANGELOG.md#074---2024-03-11)

[Compare
Source](https://togithub.com/launchbadge/sqlx/compare/v0.7.3...v0.7.4)

38 pull requests were merged this release cycle.

This is officially the **last** release of the 0.7.x release cycle.

As of this release, development of 0.8.0 has begun on `main` and only
high-priority bugfixes may be backported.

##### Added

- \[[#&#8203;2891]]: feat: expose getters for connect options fields
\[\[[@&#8203;saiintbrisson](https://togithub.com/saiintbrisson)]]
- \[[#&#8203;2902]]: feat: add `to_url_lossy` to connect options
\[\[[@&#8203;lily-mosquitoes](https://togithub.com/lily-mosquitoes)]]
- \[[#&#8203;2927]]: Support `query!` for cargo-free systems
\[\[[@&#8203;kshramt](https://togithub.com/kshramt)]]
- \[[#&#8203;2997]]: doc(FAQ): add entry explaining prepared statements
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3001]]: Update README to clarify MariaDB support
\[\[[@&#8203;iangilfillan](https://togithub.com/iangilfillan)]]
- \[[#&#8203;3004]]: feat(logging): Add numeric elapsed time field
elapsed_secs \[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]
- \[[#&#8203;3007]]: feat: add `raw_sql` API
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- This hopefully makes it easier to find how to execute statements which
are not supported by the default
        prepared statement interfaces `query*()` and `query!()`.
- Improved documentation across the board for the `query*()` functions.
- Deprecated: `execute_many()` and `fetch_many()` on interfaces that use
prepared statements.
- Multiple SQL statements in one query string were only supported by
SQLite because its prepared statement
interface is the *only* way to execute SQL. All other database flavors
forbid multiple statements in
one prepared statement string as an extra defense against SQL injection.
- The new `raw_sql` API retains this functionality because it explicitly
does *not* use prepared statements.
Raw or text-mode query interfaces generally allow multiple statements in
one query string, and this is
supported by all current databases. Due to their nature, however, one
cannot use bind parameters with them.
- If this change affects you, an issue is open for discussion:
[https://github.com/launchbadge/sqlx/issues/3108](https://togithub.com/launchbadge/sqlx/issues/3108)
- \[[#&#8203;3011]]: Added support to IpAddr with MySQL/MariaDB.
\[\[[@&#8203;Icerath](https://togithub.com/Icerath)]]
- \[[#&#8203;3013]]: Add default implementation for PgInterval
\[\[[@&#8203;pawurb](https://togithub.com/pawurb)]]
- \[[#&#8203;3018]]: Add default implementation for PgMoney
\[\[[@&#8203;pawurb](https://togithub.com/pawurb)]]
- \[[#&#8203;3026]]: Update docs to reflect support for MariaDB data
types \[\[[@&#8203;iangilfillan](https://togithub.com/iangilfillan)]]
- \[[#&#8203;3037]]: feat(mysql): allow to connect with mysql driver
without default behavor
\[\[[@&#8203;darkecho731](https://togithub.com/darkecho731)]]

##### Changed

- \[[#&#8203;2900]]: Show latest url to docs for macro.migrate
\[\[[@&#8203;Vrajs16](https://togithub.com/Vrajs16)]]
- \[[#&#8203;2914]]: Use `create_new` instead of `atomic-file-write`
\[\[[@&#8203;mattfbacon](https://togithub.com/mattfbacon)]]
- \[[#&#8203;2926]]: docs: update example for `PgConnectOptions`
\[\[[@&#8203;Fyko](https://togithub.com/Fyko)]]
- \[[#&#8203;2989]]: sqlx-core: Remove dotenvy dependency
\[\[[@&#8203;joshtriplett](https://togithub.com/joshtriplett)]]
- \[[#&#8203;2996]]: chore: Update ahash to 0.8.7
\[\[[@&#8203;takenoko-gohan](https://togithub.com/takenoko-gohan)]]
- \[[#&#8203;3006]]: chore(deps): Replace unmaintained tempdir crate
with tempfile \[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]
- \[[#&#8203;3008]]: chore: Ignore .sqlx folder created by running ci
steps locally \[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]
- \[[#&#8203;3009]]: chore(dev-deps): Upgrade env_logger from 0.9 to
0.11 \[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]
- \[[#&#8203;3010]]: chore(deps): Upgrade criterion to 0.5.1
\[\[[@&#8203;iamjpotts](https://togithub.com/iamjpotts)]]
- \[[#&#8203;3050]]: Optimize SASL auth in sqlx-postgres
\[\[[@&#8203;mirek26](https://togithub.com/mirek26)]]
- \[[#&#8203;3055]]: Set TCP_NODELAY option on TCP sockets
\[\[[@&#8203;mirek26](https://togithub.com/mirek26)]]
- \[[#&#8203;3065]]: Improve max_lifetime handling
\[\[[@&#8203;mirek26](https://togithub.com/mirek26)]]
- \[[#&#8203;3072]]: Change the name of "inner" function generated by
`#[sqlx::test]` \[\[[@&#8203;ciffelia](https://togithub.com/ciffelia)]]
- \[[#&#8203;3083]]: Remove sha1 because it's not being used in postgres
\[\[[@&#8203;rafaelGuerreiro](https://togithub.com/rafaelGuerreiro)]]

##### Fixed

- \[[#&#8203;2898]]: Fixed docs
\[\[[@&#8203;Vrajs16](https://togithub.com/Vrajs16)]]
- \[[#&#8203;2905]]: fix(mysql): Close prepared statement if persistence
is disabled
\[\[[@&#8203;larsschumacher](https://togithub.com/larsschumacher)]]
- \[[#&#8203;2913]]: Fix handling of deferred constraints
\[\[[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw)]]
- \[[#&#8203;2919]]: fix duplicate "\`" in FromRow "default" attribute
doc comment \[\[[@&#8203;shengsheng](https://togithub.com/shengsheng)]]
- \[[#&#8203;2932]]: fix(postgres): avoid unnecessary flush in
PgCopyIn::read_from \[\[[@&#8203;tsing](https://togithub.com/tsing)]]
- \[[#&#8203;2955]]: Minor fixes
\[\[[@&#8203;Dawsoncodes](https://togithub.com/Dawsoncodes)]]
- \[[#&#8203;2963]]: Fixed ReadMe badge styling
\[\[[@&#8203;tadghh](https://togithub.com/tadghh)]]
- \[[#&#8203;2976]]: fix: AnyRow not support PgType::Varchar
\[\[[@&#8203;holicc](https://togithub.com/holicc)]]
- \[[#&#8203;3053]]: fix: do not panic when binding a large BigDecimal
\[\[[@&#8203;Ekleog](https://togithub.com/Ekleog)]]
- \[[#&#8203;3056]]: fix: spans in sqlite tracing
([#&#8203;2876](https://togithub.com/launchbadge/sqlx/issues/2876))
\[\[[@&#8203;zoomiti](https://togithub.com/zoomiti)]]
- \[[#&#8203;3089]]: fix(migrate): improve error message when parsing
version from filename
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;3098]]: Migrations fixes
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
    -   Unhides `sqlx::migrate::Migrator`.
- Improves I/O error message when failing to read a file in
`migrate!()`.

[#&#8203;2891]: https://togithub.com/launchbadge/sqlx/pull/2891

[#&#8203;2898]: https://togithub.com/launchbadge/sqlx/pull/2898

[#&#8203;2900]: https://togithub.com/launchbadge/sqlx/pull/2900

[#&#8203;2902]: https://togithub.com/launchbadge/sqlx/pull/2902

[#&#8203;2905]: https://togithub.com/launchbadge/sqlx/pull/2905

[#&#8203;2913]: https://togithub.com/launchbadge/sqlx/pull/2913

[#&#8203;2914]: https://togithub.com/launchbadge/sqlx/pull/2914

[#&#8203;2919]: https://togithub.com/launchbadge/sqlx/pull/2919

[#&#8203;2926]: https://togithub.com/launchbadge/sqlx/pull/2926

[#&#8203;2927]: https://togithub.com/launchbadge/sqlx/pull/2927

[#&#8203;2932]: https://togithub.com/launchbadge/sqlx/pull/2932

[#&#8203;2955]: https://togithub.com/launchbadge/sqlx/pull/2955

[#&#8203;2963]: https://togithub.com/launchbadge/sqlx/pull/2963

[#&#8203;2976]: https://togithub.com/launchbadge/sqlx/pull/2976

[#&#8203;2989]: https://togithub.com/launchbadge/sqlx/pull/2989

[#&#8203;2996]: https://togithub.com/launchbadge/sqlx/pull/2996

[#&#8203;2997]: https://togithub.com/launchbadge/sqlx/pull/2997

[#&#8203;3001]: https://togithub.com/launchbadge/sqlx/pull/3001

[#&#8203;3004]: https://togithub.com/launchbadge/sqlx/pull/3004

[#&#8203;3006]: https://togithub.com/launchbadge/sqlx/pull/3006

[#&#8203;3007]: https://togithub.com/launchbadge/sqlx/pull/3007

[#&#8203;3008]: https://togithub.com/launchbadge/sqlx/pull/3008

[#&#8203;3009]: https://togithub.com/launchbadge/sqlx/pull/3009

[#&#8203;3010]: https://togithub.com/launchbadge/sqlx/pull/3010

[#&#8203;3011]: https://togithub.com/launchbadge/sqlx/pull/3011

[#&#8203;3013]: https://togithub.com/launchbadge/sqlx/pull/3013

[#&#8203;3018]: https://togithub.com/launchbadge/sqlx/pull/3018

[#&#8203;3026]: https://togithub.com/launchbadge/sqlx/pull/3026

[#&#8203;3037]: https://togithub.com/launchbadge/sqlx/pull/3037

[#&#8203;3050]: https://togithub.com/launchbadge/sqlx/pull/3050

[#&#8203;3053]: https://togithub.com/launchbadge/sqlx/pull/3053

[#&#8203;3055]: https://togithub.com/launchbadge/sqlx/pull/3055

[#&#8203;3056]: https://togithub.com/launchbadge/sqlx/pull/3056

[#&#8203;3065]: https://togithub.com/launchbadge/sqlx/pull/3065

[#&#8203;3072]: https://togithub.com/launchbadge/sqlx/pull/3072

[#&#8203;3083]: https://togithub.com/launchbadge/sqlx/pull/3083

[#&#8203;3089]: https://togithub.com/launchbadge/sqlx/pull/3089

[#&#8203;3098]: https://togithub.com/launchbadge/sqlx/pull/3098

###
[`v0.7.3`](https://togithub.com/launchbadge/sqlx/blob/HEAD/CHANGELOG.md#073---2023-11-22)

38 pull requests were merged this release cycle.

##### Added

- \[[#&#8203;2478]]: feat(citext): support postgres citext
\[\[[@&#8203;hgranthorner](https://togithub.com/hgranthorner)]]
- \[[#&#8203;2545]]: Add `fixtures_path` in sqlx::test args
\[\[[@&#8203;ripa1995](https://togithub.com/ripa1995)]]
- \[[#&#8203;2665]]: feat(mysql): support packet splitting
\[\[[@&#8203;tk2217](https://togithub.com/tk2217)]]
- \[[#&#8203;2752]]: Enhancement
[#&#8203;2747](https://togithub.com/launchbadge/sqlx/issues/2747)
Provide `fn PgConnectOptions::get_host(&self)`
\[\[[@&#8203;boris-lok](https://togithub.com/boris-lok)]]
- \[[#&#8203;2769]]: Customize the macro error message based on the
metadata \[\[[@&#8203;Nemo157](https://togithub.com/Nemo157)]]
- \[[#&#8203;2793]]: derived Hash trait for PgInterval
\[\[[@&#8203;yasamoka](https://togithub.com/yasamoka)]]
- \[[#&#8203;2801]]: derive FromRow: sqlx(default) for all fields
\[\[[@&#8203;grgi](https://togithub.com/grgi)]]
- \[[#&#8203;2827]]: Add impl `FromRow` for the unit type
\[\[[@&#8203;nanoqsh](https://togithub.com/nanoqsh)]]
- \[[#&#8203;2871]]: Add `MySqlConnectOptions::get_database()`
\[\[[@&#8203;shiftrightonce](https://togithub.com/shiftrightonce)]]
- \[[#&#8203;2873]]: Sqlx Cli: Added force flag to drop database for
postgres \[\[[@&#8203;Vrajs16](https://togithub.com/Vrajs16)]]
- \[[#&#8203;2894]]: feat: `Text` adapter
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]

##### Changed

- \[[#&#8203;2701]]: Remove documentation on offline feature
\[\[[@&#8203;Baptistemontan](https://togithub.com/Baptistemontan)]]
- \[[#&#8203;2713]]: Add additional info regarding using Transaction and
PoolConnection as…
\[\[[@&#8203;satwanjyu](https://togithub.com/satwanjyu)]]
- \[[#&#8203;2770]]: Update README.md
\[\[[@&#8203;snspinn](https://togithub.com/snspinn)]]
- \[[#&#8203;2797]]: doc(mysql): document behavior regarding `BOOLEAN`
and the query macros
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;2803]]: Don't use separate temp dir for query jsons (2)
\[\[[@&#8203;mattfbacon](https://togithub.com/mattfbacon)]]
- \[[#&#8203;2819]]: postgres begin cancel safe
\[\[[@&#8203;conradludgate](https://togithub.com/conradludgate)]]
- \[[#&#8203;2832]]: Update extra_float_digits default to 2 instead of 3
\[\[[@&#8203;brianheineman](https://togithub.com/brianheineman)]]
- \[[#&#8203;2865]]: Update Faq - Bulk upsert with optional fields
\[\[[@&#8203;Vrajs16](https://togithub.com/Vrajs16)]]
- \[[#&#8203;2880]]: feat: use specific message for slow query logs
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;2882]]: Do not require db url for prepare
\[\[[@&#8203;tamasfe](https://togithub.com/tamasfe)]]
- \[[#&#8203;2890]]: doc(sqlite): cover lack of `NUMERIC` support
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
-   \[No PR]: Upgraded `libsqlite3-sys` to 0.27.0
    -   Note: linkage to `libsqlite3-sys` is considered semver-exempt;
        see the release notes for 0.7.0 below for details.

##### Fixed

- \[[#&#8203;2640]]: fix: sqlx::macro db cleanup race condition by
adding a margin to current timestamp
\[\[[@&#8203;fhsgoncalves](https://togithub.com/fhsgoncalves)]]
- \[[#&#8203;2655]]: \[fix] Urlencode when passing filenames to sqlite3
\[\[[@&#8203;uttarayan21](https://togithub.com/uttarayan21)]]
- \[[#&#8203;2684]]: Make PgListener recover from UnexpectedEof
\[\[[@&#8203;hamiltop](https://togithub.com/hamiltop)]]
- \[[#&#8203;2688]]: fix: Make rust_decimal and bigdecimal decoding more
lenient \[\[[@&#8203;cameronbraid](https://togithub.com/cameronbraid)]]
- \[[#&#8203;2754]]: Is tests/x.py maintained? And I tried fix it.
\[\[[@&#8203;qwerty2501](https://togithub.com/qwerty2501)]]
- \[[#&#8203;2784]]: fix: decode postgres time without subsecond
\[\[[@&#8203;granddaifuku](https://togithub.com/granddaifuku)]]
- \[[#&#8203;2806]]: Depend on version of async-std with non-private
spawn-blocking \[\[[@&#8203;A248](https://togithub.com/A248)]]
- \[[#&#8203;2820]]: fix: correct decoding of `rust_decimal::Decimal`
for high-precision values
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;2822]]: issue
[#&#8203;2821](https://togithub.com/launchbadge/sqlx/issues/2821) Update
error handling logic when opening a TCP connection
\[\[[@&#8203;anupj](https://togithub.com/anupj)]]
- \[[#&#8203;2826]]: chore: bump some sqlx-core dependencies
\[\[[@&#8203;djc](https://togithub.com/djc)]]
- \[[#&#8203;2838]]: Fixes rust_decimal scale for Postgres
\[\[[@&#8203;jkleinknox](https://togithub.com/jkleinknox)]]
- \[[#&#8203;2847]]: Fix comment in `sqlx migrate add` help text
\[\[[@&#8203;cryeprecision](https://togithub.com/cryeprecision)]]
- \[[#&#8203;2850]]: fix(core): avoid unncessary wakeups in
`try_stream!()`
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;2856]]: Prevent warnings running `cargo build`
\[\[[@&#8203;nyurik](https://togithub.com/nyurik)]]
- \[[#&#8203;2864]]: fix(sqlite): use `AtomicUsize` for thread IDs
\[\[[@&#8203;abonander](https://togithub.com/abonander)]]
- \[[#&#8203;2892]]: Fixed force dropping bug
\[\[[@&#8203;Vrajs16](https://togithub.com/Vrajs16)]]

[#&#8203;2478]: https://togithub.com/launchbadge/sqlx/pull/2478

[#&#8203;2545]: https://togithub.com/launchbadge/sqlx/pull/2545

[#&#8203;2640]: https://togithub.com/launchbadge/sqlx/pull/2640

[#&#8203;2655]: https://togithub.com/launchbadge/sqlx/pull/2655

[#&#8203;2665]: https://togithub.com/launchbadge/sqlx/pull/2665

[#&#8203;2684]: https://togithub.com/launchbadge/sqlx/pull/2684

[#&#8203;2688]: https://togithub.com/launchbadge/sqlx/pull/2688

[#&#8203;2701]: https://togithub.com/launchbadge/sqlx/pull/2701

[#&#8203;2713]: https://togithub.com/launchbadge/sqlx/pull/2713

[#&#8203;2752]: https://togithub.com/launchbadge/sqlx/pull/2752

[#&#8203;2754]: https://togithub.com/launchbadge/sqlx/pull/2754

[#&#8203;2769]: https://togithub.com/launchbadge/sqlx/pull/2769

[#&#8203;2770]: https://togithub.com/launchbadge/sqlx/pull/2770

[#&#8203;2782]: https://togithub.com/launchbadge/sqlx/pull/2782

[#&#8203;2784]: https://togithub.com/launchbadge/sqlx/pull/2784

[#&#8203;2793]: https://togithub.com/launchbadge/sqlx/pull/2793

[#&#8203;2797]: https://togithub.com/launchbadge/sqlx/pull/2797

[#&#8203;2801]: https://togithub.com/launchbadge/sqlx/pull/2801

[#&#8203;2803]: https://togithub.com/launchbadge/sqlx/pull/2803

[#&#8203;2806]: https://togithub.com/launchbadge/sqlx/pull/2806

[#&#8203;2819]: https://togithub.com/launchbadge/sqlx/pull/2819

[#&#8203;2820]: https://togithub.com/launchbadge/sqlx/pull/2820

[#&#8203;2822]: https://togithub.com/launchbadge/sqlx/pull/2822

[#&#8203;2826]: https://togithub.com/launchbadge/sqlx/pull/2826

[#&#8203;2827]: https://togithub.com/launchbadge/sqlx/pull/2827

[#&#8203;2832]: https://togithub.com/launchbadge/sqlx/pull/2832

[#&#8203;2838]: https://togithub.com/launchbadge/sqlx/pull/2838

[#&#8203;2847]: https://togithub.com/launchbadge/sqlx/pull/2847

[#&#8203;2850]: https://togithub.com/launchbadge/sqlx/pull/2850

[#&#8203;2856]: https://togithub.com/launchbadge/sqlx/pull/2856

[#&#8203;2864]: https://togithub.com/launchbadge/sqlx/pull/2864

[#&#8203;2865]: https://togithub.com/launchbadge/sqlx/pull/2865

[#&#8203;2871]: https://togithub.com/launchbadge/sqlx/pull/2871

[#&#8203;2873]: https://togithub.com/launchbadge/sqlx/pull/2873

[#&#8203;2880]: https://togithub.com/launchbadge/sqlx/pull/2880

[#&#8203;2882]: https://togithub.com/launchbadge/sqlx/pull/2882

[#&#8203;2890]: https://togithub.com/launchbadge/sqlx/pull/2890

[#&#8203;2892]: https://togithub.com/launchbadge/sqlx/pull/2892

[#&#8203;2894]: https://togithub.com/launchbadge/sqlx/pull/2894

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "" in timezone America/New_York,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-08-28 21:08:15 -07:00
CharlesChen0823
400e503d9b
project_search: Add ability to search only for opened files (#16580)
Any suggestion?

Release Notes:
  - add ability for project search only for opend files.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-08-28 21:41:29 -06:00
CharlesChen0823
a5b82b2bf3
project_panel: Add support for copy/paste between different worktrees (#15396)
Closes https://github.com/zed-industries/zed/issues/5362

Release Notes:

- Added a way to copy/cut-paste between different worktrees ([#5362](https://github.com/zed-industries/zed/issues/5362))
2024-08-28 11:35:18 +03:00
Conrad Irwin
22a791d9c7
Bump collab min version to 0.134 (#16918)
0.05% of requests use a version less than this today; and it lets us get
  rid of a bunch of versioning we no longer need.

Release Notes:

- N/A
2024-08-27 21:44:00 -06:00
Conrad Irwin
ef22372f0b
SSH remote search (#16915)
Co-Authored-By: Max <max@zed.dev>

Release Notes:

- ssh remoting: add project search

---------

Co-authored-by: Max <max@zed.dev>
2024-08-26 14:47:02 -06:00
Marshall Bowers
93a7682659
collab: Count active users based on the tokens per minute measure (#16911)
This PR fixes an issue where active user counts were being computed
across _all_ measures instead of the per-minute measures.

We now compute them using the tokens per minute measure, as we're
concerned with usage in recent minutes.

Release Notes:

- N/A
2024-08-26 15:04:55 -04:00
TheCub3
2f08a0a28c
Fix fifo files hanging the project wide search (#16039)
Release Notes:

- Fixed the issue related to the project wide search being stuck when
project contains .fifo files
- Might potentially solve the following issue
https://github.com/zed-industries/zed/issues/7360
2024-08-26 10:40:20 -06:00
Marshall Bowers
340662e2f7
collab: Add lifetime spending limit for LLM usage (#16780)
This PR adds a lifetime spending limit on LLM usage.

Exceeding this limit will prevent further use of the Zed LLM provider.

Currently the cap is $1,000.

Release Notes:

- N/A
2024-08-23 16:41:16 -04:00
Conrad Irwin
0fd5030297
Rename is_local to is_local_or_ssh (#16717)
Release Notes:

- N/A
2024-08-22 21:32:51 -06:00
Marshall Bowers
db4ff7da6b
collab: Look up users using github_user_id when backfilling (#16708)
This PR updates the user backfiller to look up the GitHub users using
the `github_user_id` instead of `github_login`.

Release Notes:

- N/A
2024-08-22 19:58:04 -04:00
Marshall Bowers
78120cc568
collab: Upsert users by github_user_id instead of github_login (#16706)
This PR makes it so users are upserted by their `github_user_id` instead
of by their `github_login`.

The `github_user_id` is a stable identifier that does not change, while
the `github_login` can change.

In practice we were already using
`get_or_create_user_by_github_account`, which already checks for an
existing user with a `github_user_id` first, so this change doesn't
result in a change in behavior.

This change is primarily for correctness in the event that `create_user`
is called directly, as we want to be upserting by the stable identifier.

Release Notes:

- N/A
2024-08-22 19:15:32 -04:00
Marshall Bowers
4ddf2cbb9f
collab: Make users.github_user_id required and unique (#16704)
This PR makes the `github_user_id` column on the `users` table required
and replaces the index with a unique index.

I have gone through and ensured that all users have a unique
`github_user_id` in the staging and production databases.

Release Notes:

- N/A
2024-08-22 18:27:22 -04:00
Marshall Bowers
1d986b0c77
collab: Report active user counts separately, as well (#16629)
This PR adds additional reporting of the active user counts as separate
logs.

We were already reporting these on individual rate limit events/logs,
but it seems like something that would be good to report on independent
of user activity.

Release Notes:

- N/A
2024-08-21 18:15:15 -04:00
Marshall Bowers
0229d3ccac
collab: Track active user counts independently for each model (#16624)
This PR fixes an issue where the active user count spanned individual
models.

We now track the active user counts on a per-model basis.

Release Notes:

- N/A
2024-08-21 17:19:47 -04:00
Marshall Bowers
96bcceed40
collab: Add traces for user LLM rate limits (#16610)
This PR adds traces for when users hit LLM rate limits.

We were already emitting telemetry events for these to Clickhouse, but
it will be handy to have them available in Axiom as well.

Release Notes:

- N/A
2024-08-21 15:13:55 -04:00
Marshall Bowers
d274be67d6 Mark the user-backfiller secret as optional 2024-08-21 13:25:05 -04:00
Marshall Bowers
19f0c4af6d
collab: Update user backfiller to be mindful of GitHub rate limits (#16602)
This PR updates the user backfiller to be mindful of GitHub rate limits
and back off when rate-limited.

Release Notes:

- N/A
2024-08-21 13:23:24 -04:00
Marshall Bowers
8a5fcc2c22
collab: Backfill github_user_created_at on users (#16600)
This PR adds a backfiller to backfill the `github_user_created_at`
column on users.

Release Notes:

- N/A
2024-08-21 12:38:51 -04:00
Marshall Bowers
395a68133d
Add Postgrest to Docker Compose (#16498)
This PR adds two Postgrest containers—one for the app database and one
for the LLM database—to the Docker Compose cluster.

Also fixed an issue where `postgres_app.conf` and `postgres_llm.conf`
had been switched.

Release Notes:

- N/A
2024-08-19 20:50:45 -04:00
Max Brunsfeld
b5bd8a5c5d
Add logic for closed beta LLM models (#16482)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-19 11:09:52 -07:00
Marshall Bowers
de41c151c8
collab: Add is_staff to upstream rate limit spans (#16463)
This PR adds the `is_staff` field to the `upstream rate limit` spans.

Since we use different API keys for staff vs non-staff, it will be
useful to break down the rate limits accordingly.

Release Notes:

- N/A
2024-08-19 10:15:25 -04:00
Joseph T. Lyons
ebecd7e65f
Fix issue with fetching users in seed script (#16393)
Release Notes:

- N/A
2024-08-16 21:51:51 -04:00
Marshall Bowers
3d997e5fd6
collab: Add is_staff to spans (#16389)
This PR adds the `is_staff` field to our LLM spans so that we can
distinguish between staff and non-staff traffic.

Release Notes:

- N/A
2024-08-16 18:42:44 -04:00
Max Brunsfeld
1b1070e0f7
Add tracing needed for LLM rate limit dashboards (#16388)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-16 17:52:31 -04:00
Joseph T. Lyons
9ef3306f55
Add feature flags to seed script (#16385)
Release Notes:

- N/A
2024-08-16 17:08:44 -04:00
Marshall Bowers
35cd397a40
collab: Allow enabling feature flags for all users (#16372)
This PR adds a new `enabled_for_all` column to the `feature_flags` table
to allow enabling a feature flag for all users.

Release Notes:

- N/A
2024-08-16 15:17:03 -04:00
Marshall Bowers
a9441879c3
collab: Fix writing LLM rate limit events to Clickhouse (#16367)
This PR fixes the writing of LLM rate limit events to Clickhouse.

We had a table in the table name: `llm_rate_limits` instead of
`llm_rate_limit_events`.

I also extracted a helper function to write to Clickhouse so we can use
it anywhere we need to.

Release Notes:

- N/A
2024-08-16 14:03:34 -04:00
Marshall Bowers
7a5acc0b0c
collab: Rework model name checks (#16365)
This PR reworks how we do checks for model names in the LLM service.

We now normalize the model names using the models defined in the
database.

Release Notes:

- N/A
2024-08-16 13:54:28 -04:00
Marshall Bowers
583959f82a
collab: Add support for reading boolean values from .env.toml (#16317)
This PR adds support for reading boolean values from `.env.toml`, since
it wasn't supported previously.

Release Notes:

- N/A
2024-08-15 17:07:17 -04:00
Marshall Bowers
9233418cb8
collab: Attach GitHub login to LLM spans (#16316)
This PR updates the LLM service to include the GitHub login on its
spans.

We need to pass this information through on the LLM token, so it will
temporarily be `None` until this change is deployed and new tokens have
been issued.

Release Notes:

- N/A
2024-08-15 17:06:20 -04:00
Marshall Bowers
5e05821d18
collab: Attach user_id to LLM spans (#16311)
This PR updates the LLM service to attach the user ID to the spans.

Release Notes:

- N/A
2024-08-15 15:49:12 -04:00
Max Brunsfeld
6b7664ef4a
Fix bugs preventing non-staff users from using LLM service (#16307)
- db deadlock in GetLlmToken for non-staff users
- typo in allowed model name for non-staff users

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
2024-08-15 11:21:19 -07:00
Marshall Bowers
b4c22cc861
collab: Add ability to revoke LLM service access tokens (#16143)
This PR adds the ability to revoke access tokens for the LLM service.

There is a new `revoked_access_tokens` table that contains the
identifiers (`jti`) of revoked access tokens.

To revoke an access token, insert a record into this table:

```sql
insert into revoked_access_tokens (jti) values ('1e887b9e-37f5-49e8-8feb-3274e5a86b67');
```

We now attach the `jti` as `authn.jti` to the tracing spans so that we
can associate an access token with a given request to the LLM service.

Release Notes:

- N/A
2024-08-12 21:47:05 -04:00
Max Brunsfeld
dbcd06642c
Track lifetime spending for each user and model (#16137)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-12 20:15:26 -04:00
Marshall Bowers
8a148f3a13
Add feature-flagged access to LLM service (#16136)
This PR adds feature-flagged access to the LLM service.

We've repurposed the `language-models` feature flag to be used for
providing access to Claude 3.5 Sonnet through the Zed provider.

The remaining RPC endpoints that were previously behind the
`language-models` feature flag are now behind a staff check.

We also put some Zed Pro related messaging behind a feature flag.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-08-12 18:13:40 -04:00
Marshall Bowers
98516b5527
collab: Restrict usage of the LLM service to accounts older than 30 days (#16133)
This PR restricts usage of the LLM service to accounts older than 30
days.

We now store the GitHub user's `created_at` timestamp to check the
GitHub account age. If this is not set—which it won't be for existing
users—then we use the `created_at` timestamp in the Zed database.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-08-12 17:27:21 -04:00
Max Brunsfeld
a3c79218c4
Report telemetry events for rate limit errors (#16130)
clickhouse telemetry schema:

```
CREATE TABLE default.llm_rate_limit_events
(
    `time` DateTime64(3),
    `user_id` Int32,
    `is_staff` Bool,
    `plan` LowCardinality(String),
    `model` String,
    `provider` LowCardinality(String),
    `usage_measure` LowCardinality(String),
    `requests_this_minute` UInt64,
    `tokens_this_minute` UInt64,
    `tokens_this_day` UInt64,
    `max_requests_per_minute` UInt64,
    `max_tokens_per_minute` UInt64,
    `max_tokens_per_day` UInt64,
    `users_in_recent_minutes` UInt64,
    `users_in_recent_days` UInt64
)
ORDER BY tuple()
```

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-12 16:31:11 -04:00
Max Brunsfeld
1674e12ccb
Expose anthropic API errors to the client (#16129)
Now, when an anthropic request is invalid or anthropic's API is down,
we'll expose that to the user instead of just returning a generic 500.

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-12 13:11:48 -07:00
Marshall Bowers
f3ec8d425f
collab: Use a separate Anthropic API key for Zed staff (#16128)
This PR makes it so Zed staff can use a separate Anthropic API key for
the LLM service.

We also added an `is_staff` column to the `usages` table so that we can
exclude staff usage from the "active users" metrics that influence the
rate limits.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-08-12 15:20:34 -04:00
Marshall Bowers
ebdde5994d
collab: Don't issue LLM API tokens if the user has not accepted the ToS (#16123)
This PR adds a check to the LLM API token issuance to ensure that we
only issue tokens to users that have accepted the terms of service.

Release Notes:

- N/A
2024-08-12 14:10:08 -04:00
Marshall Bowers
ebdb755fef
Surface upstream rate limits from Anthropic (#16118)
This PR makes it so hitting upstream rate limits from Anthropic result
in an HTTP 429 response instead of an HTTP 500.

To do this we need to surface structured errors out of the `anthropic`
crate.

Release Notes:

- N/A
2024-08-12 11:59:24 -04:00
Thorsten Ball
fbb533b3e0
assistant: Require user to accept TOS for cloud provider (#16111)
This adds the requirement for users to accept the terms of service the
first time they send a message with the Cloud provider.

Once this is out and in a nightly, we need to add the check to the
server side too, to authenticate access to the models.

Demo:


https://github.com/user-attachments/assets/0edebf74-8120-4fa2-b801-bb76f04e8a17



Release Notes:

- N/A
2024-08-12 17:43:35 +02:00
Marshall Bowers
f952126319
collab: Remove LLM completions over RPC (#16114)
This PR removes the LLM completion messages from the RPC protocol, as
these now go through the LLM service as of #16113.

Release Notes:

- N/A
2024-08-12 10:08:56 -04:00
Marshall Bowers
3140d6ce8c
collab: Temporarily bypass LLM rate limiting for staff (#16089)
This PR makes it so staff members will be exempt from rate limiting by
the LLM service.

This is just a temporary measure until we can tweak the rate-limiting
heuristics.

Staff members are still subject to upstream LLM provider rate limits.

Release Notes:

- N/A
2024-08-11 14:41:49 -04:00
Max Brunsfeld
33e120d964
Capture telemetry data on per-user monthly LLM spending (#16050)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-09 16:38:37 -07:00
Max Brunsfeld
8688b2ad19
Add telemetry for LLM usage (#16049)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-09 18:15:57 -04:00