Skip to content

[Help Wanted] Please Make lib.rs/build_template public #377

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

Open
thegenius opened this issue Mar 21, 2025 · 2 comments
Open

[Help Wanted] Please Make lib.rs/build_template public #377

thegenius opened this issue Mar 21, 2025 · 2 comments

Comments

@thegenius
Copy link

thegenius commented Mar 21, 2025

I'am the author of TaiTan-Orm TaiTan-ORM,
And template support is the most important feature.
I formally use rinja template engine, and now use askama instead.

now I can implement a Template Query like this:

#[derive(askama::Template, Template, Debug)]
#[template(source="SELECT * FROM users WHERE name= :{name} {% if age.is_some() %}  AND age = :{age} {% endif %}", ext="txt")]
pub struct Query {
   name: String,
   age: Option<i64>
}

But it is ugly to write both askama::Template and Template,
And it wll be appreciate if there is any possible to make lib.rs/build_template public.

@Kijewski
Copy link
Collaborator

Hm, that is not possible. A proc-macro crate can only export proc-macros. You would need access to askama_derive_standalone. I wonder if there would be other possible users for our code generator.

@thegenius
Copy link
Author

Hm, that is not possible. A proc-macro crate can only export proc-macros. You would need access to askama_derive_standalone. I wonder if there would be other possible users for our code generator.

Yes, what we actually needed is the code generator, and it will be a great improve if the code generator would be open and used by other library, like Taitan-ORM.

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

No branches or pull requests

2 participants