Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tests that show the sum() functions aren't polymorphic yet
  • Loading branch information
Jille committed Mar 24, 2024
commit eafc64a389bffe72a15674b3876d24ef849e14a5
11 changes: 7 additions & 4 deletions internal/endtoend/testdata/func_match_types/mysql/go/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions internal/endtoend/testdata/func_match_types/mysql/go/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- name: AuthorPages :many
select author, count(title) as num_books, SUM(pages) as total_pages
select author, count(title) as num_books, SUM(pages) as total_pages, SUM(score) AS sum_score, SUM(price) AS sum_price, SUM(avg_word_length) as sum_avg_length
from books
group by author;
5 changes: 4 additions & 1 deletion internal/endtoend/testdata/func_match_types/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ CREATE TABLE books (
id integer PRIMARY KEY,
title text NOT NULL,
author text NOT NULL,
pages integer NOT NULL
pages integer NOT NULL,
score float NOT NULL,
price decimal(4, 2) NOT NULL,
avg_word_length double NOT NULL
);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- name: AuthorPages :many
select author, count(title) as num_books, SUM(pages) as total_pages
select author, count(title) as num_books, SUM(pages) as total_pages, SUM(score) AS sum_score, SUM(price) AS sum_price, SUM(avg_word_length) as sum_avg_length
from books
group by author;
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ CREATE TABLE books (
id integer PRIMARY KEY,
title text NOT NULL,
author text NOT NULL,
pages integer NOT NULL
pages integer NOT NULL,
score float NOT NULL,
price DECIMAL(4, 2) NOT NULL,
avg_word_length DOUBLE NOT NULL
);