Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Additional DB refactoring #314

Closed
1 of 4 tasks
DeliciousHair opened this issue Oct 14, 2021 · 3 comments
Closed
1 of 4 tasks

Additional DB refactoring #314

DeliciousHair opened this issue Oct 14, 2021 · 3 comments

Comments

@DeliciousHair
Copy link
Contributor

DeliciousHair commented Oct 14, 2021

#88 has been addressed about as much as we can for the moment via #295. However, the task is somewhat incomplete owing to features that have not yet been implemented in sqlx. This issue is thus a placeholder to track the external issues that will enable a more complete refactoring here. In particular:

DeliciousHair added a commit that referenced this issue Oct 14, 2021
The primary goal was to remove all of the calls to `serde_json::to_string()`
for the data-handling, thus enabling us to do (more or less):

```rust
Order {
    row.column,
    ...
}
```

as well as clean up the SQL for easier reading. This has mostly been
accomplished, with further refinements easily accomplished once the
upstream issues in `sqlx` are addressed. See #314 for issues we are
tracking.
DeliciousHair added a commit that referenced this issue Oct 14, 2021
The primary goal was to remove all of the calls to `serde_json::to_string()`
for the data-handling, thus enabling us to do (more or less):

```rust
Order {
    row.column,
    ...
}
```

as well as clean up the SQL for easier reading. This has mostly been
accomplished, with further refinements easily accomplished once the
upstream issues in `sqlx` are addressed. See #314 for issues we are
tracking.
bors bot added a commit that referenced this issue Oct 14, 2021
295: Db refactor r=thomaseizinger a=DeliciousHair

 DB code refactoring for #88

The primary goal was to remove all of the calls to `serde_json::to_string()` for the data-handling, thus enabling us to do (more or less):

```rust
Order {
    row.column,
    ...
}
```

as well as clean up the SQL for easier reading. This has mostly been accomplished, with further refinements easily accomplished once the upstream issues in `sqlx` are addressed. See #314 for issues we are tracking.



Co-authored-by: DelicioiusHair <mshepit@gmail.com>
thomaseizinger pushed a commit that referenced this issue Oct 15, 2021
The primary goal was to remove all of the calls to `serde_json::to_string()`
for the data-handling, thus enabling us to do (more or less):

```rust
Order {
    row.column,
    ...
}
```

as well as clean up the SQL for easier reading. This has mostly been
accomplished, with further refinements easily accomplished once the
upstream issues in `sqlx` are addressed. See #314 for issues we are
tracking.
thomaseizinger pushed a commit that referenced this issue Oct 15, 2021
The primary goal was to remove all of the calls to `serde_json::to_string()`
for the data-handling, thus enabling us to do (more or less):

```rust
Order {
    row.column,
    ...
}
```

as well as clean up the SQL for easier reading. This has mostly been
accomplished, with further refinements easily accomplished once the
upstream issues in `sqlx` are addressed. See #314 for issues we are
tracking.
@thomaseizinger
Copy link
Contributor

I just had an epiphany in regards to launchbadge/sqlx#1493.

Custom derives are essentially just code generation, meaning they are bound to the same module privacy rules as hand-written code. Thus, if a custom derive can generate code, it must be possible to write this code by hand.

@DeliciousHair I don't know how we failed to implement sqlx::Type manually but it must be possible somehow.

Perhaps the correct combination is:

  • derive sqlx::Type without adding sqlx(transparent)
  • implement Encode and Decode manually

@DeliciousHair
Copy link
Contributor Author

I don't know how we failed to implement sqlx::Type manually but it must be possible somehow.

Sounds plenty reasonable to me, I'll give it a shot!

@klochowicz
Copy link
Contributor

closing as outdated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants