-
Notifications
You must be signed in to change notification settings - Fork 13
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
typesql_parser maintainer #63
Comments
Hi thanks for the issue. Yes, you can send the question through this repo. I may be able to help you. |
First thing first - Where is the repo for this package? I cant find it. |
All the directories for each package in the repo are presented in the readme. The That's right, since the compilation of the wasm module may take some time it's better to make it async. |
I dont see the visitor functionality that present in rust lib. |
Thanks for your great questions, and sorry there aren't many docs about the package. The visitor implementation is exposed within the /lib/visitor.dart file and an usage example is the |
I see you started to implement typesql_generator I am trying to build a generator too. Like sqlc package in golang(But maybe better :)) |
You can try it out and let me know what you think, it's on pub.dev. I believe it supports most primitives and even JSON. If there is something missing you may create an issue or open a PR. |
Hmm... Right now its generating me code with errors. For example: -- name: complexQuery :many
select employee_id, name, department_id, salary
from employees
where
(department_id = ? or ? is null)
and (salary >= ? or ? is null)
and (hire_date between ? and ? or (? is null and ? is null))
and (skills->>? = ? OR ? IS NULL)
ORDER BY
CASE WHEN ? = 'salary' THEN salary END DESC,
CASE WHEN ? = 'hire_date' THEN hire_date END DESC
LIMIT ? OFFSET ?;
-- name: getUsersByStatus :many
select * from users
where status = ?;
-- name: insertNewUser :exec
insert into users (name, email, status)
values (?, ?, ?);
-- name: getUsersByIds :many
select * from users
where id in (?, ?, ?);
-- name: getUsersByAgeRange :many
select * from users
where age between ? and ?;
-- name: getLimitedUsers :many
select * from users
LIMIT ? offset ?;
-- name: getGroupsByCount :many
select status, count(*)
from users
group by status
having count(*) > ?;
-- name: orderUsersByColumn :many
select * from users
order by ? asc;
Maybe I am using it the wrong way? Tried to delete the comments in this file too with same result. |
I believe the error could be due to the name property. You have to configure it as a JSON like the example. Is there an error? Or perhaps you could provide the generated dart code? |
You will also need to provide the |
Hi.
wanted to ask some question about this package from pub.dev: https://pub.dev/packages/typesql_parser
The text was updated successfully, but these errors were encountered: