Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.0](https://github.com/cornucopia-rs/cornucopia/compare/cornucopia-v0.9.0...cornucopia-v1.0.0) - 2026-05-20

This release merges the [Clorinde](https://github.com/halcyonnouveau/clorinde) fork back into Cornucopia. The historical Clorinde changelog is preserved below for reference. See the [migration guide](https://cornucopia-rs.github.io/migration.html) for upgrading from 0.9.

### Added

- enforce edition and rust-version on the generated crate ([#301](https://github.com/cornucopia-rs/cornucopia/pull/301))
- bump cornucopia and workspace to Rust edition 2024 ([#300](https://github.com/cornucopia-rs/cornucopia/pull/300))
- warn when no queries are found ([#275](https://github.com/cornucopia-rs/cornucopia/pull/275))
- support PostgreSQL `name` type as String ([#274](https://github.com/cornucopia-rs/cornucopia/pull/274))

### Fixed

- avoid pulling in deprecated `rustc-serialize` via `eui48` in tests ([#276](https://github.com/cornucopia-rs/cornucopia/pull/276))

### Refactor

- route config deprecation warnings through `Warning` enum ([#303](https://github.com/cornucopia-rs/cornucopia/pull/303))

<!--
Entries below this point are from the upstream clorinde fork at the time of merging, preserved for
historical reference. Cornucopia changes resume above starting with v1.0.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cornucopia"
version = "0.9.0"
version = "1.0.0"
edition = "2024"
rust-version = "1.88.0"
license = "MIT/Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/introduction/migration_to_1_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Can be replaced with:
cornucopia = { path = "cornucopia" }
```

Cornucopia also re-exports the dependencies: `postgres`, `tokio-postgres`, and `deadpool-postgres`.
The generated crate also re-exports the relevant drivers (`postgres`, `tokio-postgres`, `deadpool-postgres`) based on whether you generated sync, async, or deadpool-enabled code, so you don't need to add them to your own `Cargo.toml`.

A drawback of this approach is that `cargo publish` rejects crates with path-only dependencies. If you want to publish a crate that depends on Cornucopia, you need to publish the generated crate separately first.

Expand Down
4 changes: 4 additions & 0 deletions docs/src/introduction/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
| `varchar` | `String` |
| `bpchar` | `String` |
| `name` | `String` |
| `citext` | `String` |
| `ltree` | `String` |
| `lquery` | `String` |
| `ltxtquery` | `String` |
| `bytea` | `Vec<u8>` |
| `timestamp without time zone`, `timestamp` | `chrono::NaiveDateTime` |
| `timestamp with time zone`, `timestamptz` | `chrono::DateTime<chrono::FixedOffset>` |
Expand Down
2 changes: 1 addition & 1 deletion docs/src/using_cornucopia/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Long-term configurations should live in the [`cornucopia.toml`](../configuration
The code generation can be made either against a database that you manage or by letting Cornucopia manage an ephemeral database container for you.

### `schema`: Automatic container management
The `cornucopia schema` command creates a new container, loads your schema(s), generates your queries and cleanups the container. You will need to provide the path to one or more schema files to build your queries against. This requires `docker` or `podman` to be installed.
The `cornucopia schema` command creates a new container, loads your schema(s), generates your queries and cleans up the container. You will need to provide the path to one or more schema files to build your queries against. This requires `docker` or `podman` to be installed.

### `live`: Manual database management
If you want to manage the database yourself, use the `cornucopia live` command to connect to an arbitrary live database. You will need to provide the connection URL.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/using_queries/using_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use cornucopia::queries::authors;
## Building the query object
Building a query object starts with either the query function:
```rust
authors().bind(&client, Some("Greece"));
authors().bind(&client, &Some("Greece"));
```

or the generated parameter struct:
Expand All @@ -21,7 +21,7 @@ use cornucopia::{

authors().params(
&client,
AuthorsParams {
&AuthorsParams {
country: Some("Greece")
}
);
Expand Down
6 changes: 3 additions & 3 deletions docs/src/writing_queries/type_annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ SELECT name, age, bio FROM authors;
This will generate:

```rust
#[derive(Default, serde::Deserialize, PartialEq)]
#[derive(Debug, Clone, PartialEq, serde::Deserialize)]
#[doc = "Represents an author in the system"]
#[derive(Clone)]
pub struct Author {
pub name: String,
pub age: Option<i32>,
pub bio: String,
}

#[derive(Debug)]
#[cfg_attr(feature = "graphql", derive(async_graphql::SimpleObject))]
pub struct AuthorBorrowed<'a> {
pub name: &'a str,
Expand All @@ -68,6 +66,8 @@ pub struct AuthorBorrowed<'a> {
}
```

Note that owned structs get `Debug, Clone, PartialEq` automatically (plus `Copy` when all fields are `Copy`), while borrowed structs get no automatic derives.

```admonish note
Custom attributes are declared with these tokens:
- `--#` for owned struct attributes
Expand Down