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
3 changes: 3 additions & 0 deletions examples/advanced-types/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_event(&mut self, id: i64) -> Result<GetEventRow, sqlx::Error> {
Expand Down
3 changes: 3 additions & 0 deletions examples/basic/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_author(&mut self, id: i64) -> Result<GetAuthorRow, sqlx::Error> {
Expand Down
3 changes: 3 additions & 0 deletions examples/batch/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub fn batch_get_author<'a, I>(
Expand Down
3 changes: 3 additions & 0 deletions examples/enums/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_user(&mut self, id: i64) -> Result<GetUserRow, sqlx::Error> {
Expand Down
4 changes: 4 additions & 0 deletions src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ pub fn generate(request: &GenerateRequestView<'_>, config: &Config) -> Result<St
pub fn new(db: E) -> Self {
Self { db }
}

pub fn into_inner(self) -> E {
self.db
}
}
});

Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__batch_dynamic_slice_param.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub fn batch_list_authors_by_dynamic_ids<'a, I>(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__batchexec.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub fn batch_delete_author<'a, I>(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__batchmany.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub fn batch_list_authors<'a, I>(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__batchone.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub fn batch_get_author<'a, I>(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__composite_types.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__copyfrom.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn copy_authors<I>(&mut self, items: I) -> Result<u64, sqlx::Error>
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__dynamic_slice_param.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn list_authors_by_dynamic_ids(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__embed.snap
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_author_embed(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__enum_types.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_user_status(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__exec.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn delete_author(&mut self, id: i64) -> Result<(), sqlx::Error> {
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__execlastid.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn create_author(&mut self, name: String) -> Result<i64, sqlx::Error> {
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__execresult.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn delete_author_result(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__execrows.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn delete_author_rows(&mut self, id: i64) -> Result<u64, sqlx::Error> {
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__many.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn list_authors(&mut self) -> Result<Vec<ListAuthorsRow>, sqlx::Error> {
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__multidimensional_array_types.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_matrix(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__named_params.snap
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn update_author_named_params(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__nullable_named_param.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn list_authors_by_optional_bio(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__one.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_author(&mut self, id: i64) -> Result<GetAuthorRow, sqlx::Error> {
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__range_types.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn get_event_window(
Expand Down
3 changes: 3 additions & 0 deletions tests/snapshots/codegen__slice_param.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
pub fn into_inner(self) -> E {
self.db
}
}
impl<E: AsExecutor> Queries<E> {
pub async fn list_authors_by_ids(
Expand Down
Loading