-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql/migrate: scan hash-style comments (#3220)
- Loading branch information
Showing
7 changed files
with
131 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
-- Comment 1. | ||
CREATE INDEX "i" ON "s"."t" (((c #>> '{a,b,c}'::text[]))); | ||
|
||
/* | ||
Comment 2. | ||
*/ | ||
SELECT name | ||
FROM company.employees | ||
WHERE info #>> '{department, name}' = 'Engineering'; | ||
|
||
/* | ||
SELECT name | ||
FROM company.employees | ||
WHERE info #>> '{contact, email}' = '[email protected]'; | ||
*/ | ||
SELECT name | ||
FROM company.employees | ||
WHERE info #>> '{contact, email}' = '[email protected]'; | ||
|
||
-- Comment 3. | ||
CREATE INDEX "idx_emp_department" ON "company"."employees" ( | ||
(info #>> '{department, name}') | ||
); | ||
|
||
/* | ||
CREATE INDEX "idx_emp_contact" ON "company"."employees" ( | ||
LOWER(info #>> '{contact, email}') | ||
); | ||
*/ | ||
CREATE INDEX "idx_emp_contact" ON "company"."employees" ( | ||
LOWER(info #>> '{contact, email}') | ||
); | ||
|
||
/** | ||
SELECT | ||
info #>> '{department, name}' AS department, | ||
COUNT(*) AS emp_count | ||
FROM company.employees | ||
GROUP BY info #>> '{department, name}'; | ||
*/ | ||
SELECT | ||
info #>> '{department, name}' AS department, | ||
COUNT(*) AS emp_count | ||
FROM company.employees | ||
GROUP BY info #>> '{department, name}'; | ||
|
||
/** | ||
SELECT | ||
info #>> '{department, name}' AS department, | ||
COUNT(*) AS emp_count | ||
FROM company.employees | ||
GROUP BY info #>> '{department, name}'; | ||
*/ | ||
/** | ||
SELECT | ||
info #>> '{department, name}' AS department, | ||
COUNT(*) AS emp_count | ||
FROM company.employees | ||
GROUP BY info #>> '{department, name}'; | ||
*/ | ||
SELECT name | ||
FROM company.employees | ||
WHERE (info #>> '{department, name}' = 'Engineering' | ||
OR info #>> '{department, location}' = 'Building A') | ||
AND info #>> '{contact, email}' LIKE '%@company.com'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
CREATE INDEX "i" ON "s"."t" (((c #>> '{a,b,c}'::text[]))); | ||
-- end -- | ||
SELECT name | ||
FROM company.employees | ||
WHERE info #>> '{department, name}' = 'Engineering'; | ||
-- end -- | ||
SELECT name | ||
FROM company.employees | ||
WHERE info #>> '{contact, email}' = '[email protected]'; | ||
-- end -- | ||
CREATE INDEX "idx_emp_department" ON "company"."employees" ( | ||
(info #>> '{department, name}') | ||
); | ||
-- end -- | ||
CREATE INDEX "idx_emp_contact" ON "company"."employees" ( | ||
LOWER(info #>> '{contact, email}') | ||
); | ||
-- end -- | ||
SELECT | ||
info #>> '{department, name}' AS department, | ||
COUNT(*) AS emp_count | ||
FROM company.employees | ||
GROUP BY info #>> '{department, name}'; | ||
-- end -- | ||
SELECT name | ||
FROM company.employees | ||
WHERE (info #>> '{department, name}' = 'Engineering' | ||
OR info #>> '{department, location}' = 'Building A') | ||
AND info #>> '{contact, email}' LIKE '%@company.com'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters