help-circle
rss
How can I type-check uuid and date_time in an entity generated from sqlite by sea-orm-cli?
I'm using the `sea-orm` library to manage my database. The `uuid()` and `date_time()` types are part of the `sea-orm` migration syntax. When `sea-orm` generates the entities from the SQLite database, `uuid()` and `date_time()` get converted into `String`. Should I change these types on the entities manually for some other type if I want them to be type-checked? How can I do that? What types can I use? Will I have to convert them back to `String` when importing data into the database? How can I do that?

[SOLVED] How do I run sqlite migration with sqlx and create the entities with sea-orm?
I'm having trouble making a database using sea-orm, because booleans are being converted to integers. I've written the migration in sqlite DDL instead. Now I have a `initial_schema.sql` migration file and I want to build the database with sqlx and create entities with sea-orm. How can I do that?


Presenting Activitypub-Rust crate
cross-posted from: https://lemmy.ml/post/341718 > [Activitypub](https://www.w3.org/TR/activitypub/) is decentralized social networking protocol recommended by the W3C. It provides a client to server API for creating, updating and deleting content, as well as a federated server to server API for delivering notifications and content. As part of the work on [Lemmy](https://join-lemmy.org/), we have implemented some high-level abstractions for handling the server-to-server protocol in Rust. These abstractions are now available as a standalone library. > > The main features are: > > - Data structures for federation are defined by the user, not the library. This gives you maximal flexibility, and lets you accept only messages which your code can handle. Others are rejected automatically during deserialization. > - ObjectId type, wraps the id url and allows for type safe fetching of objects, both from database and HTTP > - Queue for activity sending, handles HTTP signatures, retry with exponential backoff, all in background workers > - Inbox for receiving activities, verifies HTTP signatures, performs other basic checks and helps with routing > - Generic error type (unfortunately this was necessary) > - various helpers for verification, (de)serialization, context etc > > Documentation is currently lacking. If you want to get started with the library, best look at the example. > > The code has already been used in production as part of Lemmy for a long time, without any notable problems. However, ergonomics are lacking and need to be improved. There are also many additional features which would be worth implementing. See the project readme for details. Contributions and suggestions are very much welcome! > > You can find the project here: > > [https://github.com/LemmyNet/activitypub-federation-rust](https://github.com/LemmyNet/activitypub-federation-rust) > > [https://crates.io/crates/activitypub-federation](https://crates.io/crates/activitypub-federation)

Ask specific questions about how to code something in rust

Rust Docs

General rust discussion on lemmy.ml

Create Post From:
lemmy.ml

  • 0 users online
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 4 users / 6 months
  • 2 subscribers
  • 4 Posts
  • 2 Comments
  • Modlog
Heap Overflow
A place to ask programming questions and share free resources

General programming discussion,
Additional resources, challenges

To post or comment:

  1. Create an account on another lemmy instance
  2. Then search for the community url like here

RULES:

  1. No politics
  2. No flaming / trolling
  3. No proprietary BS
  4. Stay on topic

Please keep questions & examples short!

All content is Public Domain unless otherwise specified.
Only CC0, CC BY 3.0, or CC BY-SA 3.0 alternate licenses are allowed.

No affiliation with StackOverflow.com