Skip to content

Commit 76c4f76

Browse files
chore: Move db. to a new branch (#4349)
Co-authored-by: Aljaž Mur Eržen <[email protected]>
1 parent 51347e6 commit 76c4f76

File tree

202 files changed

+2464
-2557
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2464
-2557
lines changed

CHANGELOG.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
generates Markdown documentation from `.prql` files. (@vanillajonathan,
1111
#4152).
1212

13-
- _Breaking_: References to database tables now require an explicit `db.`
14-
prefix. Example:
15-
```prql no-eval
16-
from db.my_table
17-
join db.another_table (==some_id)
18-
```
19-
2013
**Fixes**:
2114

2215
**Documentation**:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ since it compiles to SQL.
2626
PRQL can be as simple as:
2727

2828
```elm
29-
from db.tracks
29+
from tracks
3030
filter artist == "Bob Marley" # Each line transforms the previous result
3131
aggregate { # `aggregate` reduces each column to a value
3232
plays = sum plays,
@@ -38,7 +38,7 @@ aggregate { # `aggregate` reduces each column
3838
Here's a fuller example of the language;
3939

4040
```elm
41-
from db.employees
41+
from employees
4242
filter start_date > @2021-01-01 # Clear date syntax
4343
derive { # `derive` adds columns / variables
4444
gross_salary = salary + (tax ?? 0), # Terse coalesce

lutra/bindings/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module my_database {
1616
let artists <[{artist_id = int, name = text}]>
1717
}
1818
19-
from db.my_database.artists
19+
from my_database.artists
2020
select {artist_id, text}
2121
into main
2222
```

lutra/example-project/Project.prql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ let favourite_artists = [
1212
{artist_id = 7, last_listen = @2023-05-16},
1313
]
1414

15-
favourite_artists
16-
join (chinook.artists | select {artist_id, name}) side:left (==artist_id)
15+
from favourite_artists
16+
join input = (from chinook.artists | select {artist_id, name}) side:left (==artist_id)
1717
derive aid = favourite_artists.artist_id * 2
18-
select {aid, name, favourite_artists.last_listen}
18+
select {aid, input.name, favourite_artists.last_listen}
1919
sort {-aid}

prqlc/bindings/dotnet/PrqlCompiler.Tests/CompilerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public void ToCompile_Works()
1717
};
1818

1919
// Act
20-
var result = PrqlCompiler.Compile("from db.employees", options);
20+
var result = PrqlCompiler.Compile("from employees", options);
2121

2222
// Assert
2323
Assert.Equal(expected, result.Output);
@@ -28,7 +28,7 @@ public void TestOtherFunctions()
2828
{
2929
// Arrange
3030
var query = """
31-
let a = (from db.employees | take 10)
31+
let a = (from employees | take 10)
3232
3333
from a | select {first_name}
3434
""";

prqlc/bindings/dotnet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var options = new PrqlCompilerOptions
2727
Format = false,
2828
SignatureComment = false,
2929
};
30-
var sql = PrqlCompiler.Compile("from db.employees", options);
30+
var sql = PrqlCompiler.Compile("from employees", options);
3131
Console.WriteLine(sql);
3232
```
3333

prqlc/bindings/elixir/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ end
1515
## Basic Usage
1616

1717
```elixir
18-
iex> PRQL.compile("from db.customers")
18+
iex> PRQL.compile("from customers")
1919
{:ok, "SELECT\n *\nFROM\n customers\n\n-- Generated by PRQL compiler version 0.3.1 (https://prql-lang.org)\n"}
2020

2121

22-
iex> PRQL.compile("from db.customers\ntake 10", dialect: :mssql)
22+
iex> PRQL.compile("from customers\ntake 10", dialect: :mssql)
2323
{:ok, "SELECT\n *\nFROM\n customers\nORDER BY\n (\n SELECT\n NULL\n ) OFFSET 0 ROWS\nFETCH FIRST\n 10 ROWS ONLY\n\n-- Generated by PRQL compiler version 0.3.1 (https://prql-lang.org)\n"}
2424
```
2525

prqlc/bindings/elixir/lib/prql.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ defmodule PRQL do
4747
## Examples
4848
4949
Using default `Generic` target:
50-
iex> PRQL.compile("from db.customers", signature_comment: false)
50+
iex> PRQL.compile("from customers", signature_comment: false)
5151
{:ok, "SELECT\n *\nFROM\n customers\n"}
5252
5353
5454
Using `MSSQL` target:
55-
iex> PRQL.compile("from db.customers\ntake 10", target: :mssql, signature_comment: false)
55+
iex> PRQL.compile("from customers\ntake 10", target: :mssql, signature_comment: false)
5656
{:ok, "SELECT\n *\nFROM\n customers\nORDER BY\n (\n SELECT\n NULL\n ) OFFSET 0 ROWS\nFETCH FIRST\n 10 ROWS ONLY\n"}
5757
"""
5858
@spec compile(binary(), [compile_opts()]) :: {:ok, binary()} | {:error, binary()}

prqlc/bindings/elixir/test/prql_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule PRQLTest do
55
@compile_opts [signature_comment: false]
66

77
test "compiles PRQL" do
8-
prql_query = "from db.customers"
8+
prql_query = "from customers"
99

1010
assert PRQL.compile(prql_query, @compile_opts) ==
1111
{:ok,

prqlc/bindings/java/java/src/test/java/org/prql/prql4j/PrqlCompilerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public class PrqlCompilerTest {
66
@Test
77
public void compile() throws Exception {
8-
String found = PrqlCompiler.toSql("from db.my_table", "sql.mysql", true, true);
8+
String found = PrqlCompiler.toSql("from my_table", "sql.mysql", true, true);
99

1010
// remove signature
1111
found = found.substring(0, found.indexOf("\n\n--"));
@@ -19,6 +19,6 @@ public void compile() throws Exception {
1919

2020
@Test(expected = Exception.class)
2121
public void compileWithError() throws Exception {
22-
PrqlCompiler.toSql("from db.table | filter id >> 1", "sql.mysql", true, true);
22+
PrqlCompiler.toSql("from table | filter id >> 1", "sql.mysql", true, true);
2323
}
2424
}

0 commit comments

Comments
 (0)