Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes name and schema optional in #[table] macro. #8

Closed
wants to merge 1 commit into from

Conversation

xfbs
Copy link
Contributor

@xfbs xfbs commented Nov 25, 2023

This one is more of an idea:

When you don't specify which schema to use, it falls back to using the public schema. Likewise, when you don't specify the table name, it will simply use the name of the struct.

Todo

  • snake_case the name of the struct?
  • pluralize the name of the struct?
  • use something like serde's rename = "UPPER_CASE" here?
  • make the public schema string a const?

When you don't specify which schema to use, it falls back to using the
`public` schema. Likewise, when you don't specify the table name, it
will simply use the name of the struct.
@mara-schulke
Copy link
Contributor

I like it! Especially the optional schema is a good idea. I do think it is good to be explicit about the table name here though

cdbrkfxrpt added a commit that referenced this pull request Feb 3, 2024
cdbrkfxrpt added a commit that referenced this pull request Feb 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* Guard schema for when not using SQLite

* Remove feature from macros in anticipation of #8

* Revert import merging

---------

Co-authored-by: Florian Eich <[email protected]>
@cdbrkfxrpt
Copy link
Contributor

I don't think there is a real reason for this so I'm closing the PR for now.

@cdbrkfxrpt cdbrkfxrpt closed this Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants