Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support for clorinde#384

dlight started this conversation inIdeas
Discussion options

Hello, there is a Rust SQL crate calledclorinde (a fork ofcornucopia) where you write queries like this:

--: Author(age?)--! authors : AuthorSELECT name, ageFROM Authors;--! authors_from_country (country?) : AuthorSELECT name, ageFROM AuthorsWHEREAuthors.nationality= :country;

(Example taken from here)

And then clorinde, using the database schema, generates ergonomic Rust code that performs those queries.

The queries are in a format that isalmost suitable for postgres-language-server, except that with ityou write parameters:likethis rather than the usual? or$1 syntax used in prepared statements and SQL functions respectively. So at minimum there should be support in the parser for this syntax, and this limited support would be extremely useful already.

But also, the function signatures provided by clorinde can aid the postgres lsp:country? there means that country is nullable (in the Rust side, it's anOption). And I would like to hover thecountry parameter and have the IDE tell me its type (in this case, it depends on the columnnationality of tableAuthors).

Maybe this is not appropriate for the postgres lsp, and as such it would be necessary to create a language server specific for clorinde - but the postgres lsp does 95% of the job already, and I think it's a good fit.

You must be logged in to vote

Replies: 1 comment

Comment options

hey, thanks for the suggestion! unfortunately, we do not have control over the tokeniser and the parser. We are usinglibpg_query under the hood, and only support what they support.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
2 participants
@dlight@psteinroe

[8]ページ先頭

©2009-2025 Movatter.jp