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

Support schema name #57

Merged
merged 7 commits into from
Jan 8, 2025
Merged

Support schema name #57

merged 7 commits into from
Jan 8, 2025

Conversation

NPCRUS
Copy link
Contributor

@NPCRUS NPCRUS commented Dec 28, 2024

Hello folks, here I tried to add support for schemaName into INSERT, UPDATE, DELETE and some sub variants of those. I feel 90% confused about most of the stuff I see in the repo so far, but I wanted to start somewhere, so I can gradually get a better understanding of what's going on.

Here I implemented a Table.resolve function that should make a fully qualified table name + schema if present + apply mapping from config, maybe it can also be used further for #53
I also thought it's a good idea whenever Table.Base becomes String to be used as a fully qualified name to not do any further processing and mapping of this string
Fixes #54

@NPCRUS
Copy link
Contributor Author

NPCRUS commented Dec 29, 2024

was trying to add test case for join, just in case, but I get this error:

No given instance of type scalasql.core.Queryable[
  scalasql.query.Select[
    (scalasql.Invoice[scalasql.core.Expr], scalasql.Invoice[scalasql.core.Expr])
      ,
  (scalasql.Invoice[scalasql.core.Sc], scalasql.Invoice[scalasql.core.Sc])],
Int] was found.

for this query: Invoice.select.join(Invoice)(_.id <> _.id)
not sure what's the issue

@aboisvert
Copy link
Contributor

With scalasql, you need to have a Dialect (implicit/given) in scope in order to do a select

@lihaoyi
Copy link
Member

lihaoyi commented Dec 30, 2024

@NPCRUS looks great! Just need to run this command to regenerate the docs https://github.com/com-lihaoyi/scalasql/blob/main/docs/developer.md#full-test-suite-with-documentation-generation

nikitaglushchenko added 2 commits December 30, 2024 09:16
@NPCRUS
Copy link
Contributor Author

NPCRUS commented Dec 30, 2024

With scalasql, you need to have a Dialect (implicit/given) in scope in order to do a select

I assume ScalaSqlSuite provides dialect. But I was able to fix issue by wrapping query into Text macro

@NPCRUS
Copy link
Contributor Author

NPCRUS commented Dec 31, 2024

@NPCRUS looks great! Just need to run this command to regenerate the docs https://github.com/com-lihaoyi/scalasql/blob/main/docs/developer.md#full-test-suite-with-documentation-generation

is running all tests required for docs generation by any chance?

@lihaoyi
Copy link
Member

lihaoyi commented Dec 31, 2024

@NPCRUS it is, the tests dump the sourcecode/sql to a file on disk that is then used to generate docs

@NPCRUS
Copy link
Contributor Author

NPCRUS commented Dec 31, 2024

@NPCRUS it is, the tests dump the sourcecode/sql to a file on disk that is then used to generate docs

thanks! then ill come back in a week with merge ready pr, im in a place now where certain cdn and urls are unavailable, so i cannot run all the tests. I'll ping you when its ready

@lihaoyi
Copy link
Member

lihaoyi commented Dec 31, 2024

Sounds good, take your time!

@lihaoyi lihaoyi merged commit ba5710e into com-lihaoyi:main Jan 8, 2025
6 checks passed
@lihaoyi
Copy link
Member

lihaoyi commented Jan 8, 2025

Tagged 0.1.15 with this change

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.

Table.schemaName is only supported by select query
3 participants