Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlvertol committed Aug 21, 2024
1 parent 26e3572 commit c86083d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
31 changes: 31 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6199,6 +6199,37 @@ Buyer.select
## Schema
Additional tests to ensure schema mapping produces valid SQL
### Schema.schema
If your table belongs to a schema other than the default schema of your database,
you can specify this in your table definition with table.schemaName
```scala
Invoice.select
```
*
```sql
SELECT invoice0.id AS id, invoice0.total AS total, invoice0.vendor_name AS vendor_name
FROM otherschema.invoice invoice0
```
*
```scala
Seq(
Invoice[Sc](id = 1, total = 150.4, vendor_name = "Siemens"),
Invoice[Sc](id = 2, total = 213.3, vendor_name = "Samsung"),
Invoice[Sc](id = 3, total = 407.2, vendor_name = "Shell")
)
```
## SubQuery
Queries that explicitly use subqueries (e.g. for `JOIN`s) or require subqueries to preserve the Scala semantics of the various operators
### SubQuery.sortTakeJoin
Expand Down
6 changes: 2 additions & 4 deletions scalasql/test/src/query/SchemaTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ trait SchemaTests extends ScalaSqlSuite {
query = Text {
Invoice.select
},
sql =
"""
sql = """
SELECT invoice0.id AS id, invoice0.total AS total, invoice0.vendor_name AS vendor_name
FROM otherschema.invoice invoice0
""",
Expand All @@ -25,8 +24,7 @@ trait SchemaTests extends ScalaSqlSuite {
Invoice[Sc](id = 2, total = 213.3, vendor_name = "Samsung"),
Invoice[Sc](id = 3, total = 407.2, vendor_name = "Shell")
),
docs =
"""
docs = """
If your table belongs to a schema other than the default schema of your database,
you can specify this in your table definition with table.schemaName
"""
Expand Down

0 comments on commit c86083d

Please sign in to comment.