code
stringlengths 26
870k
| docstring
stringlengths 1
65.6k
| func_name
stringlengths 1
194
| language
stringclasses 1
value | repo
stringlengths 8
68
| path
stringlengths 5
194
| url
stringlengths 46
254
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
async def test_ext_ai_indexing_02(self):
try:
qry = '''
with
result := ext::ai::search(
Stuff, <array<float32>>$qv)
select
result.object {
content,
content2,
distance := result.distance,
}
order by
result.distance asc empty last
then result.object.content;
'''
qv = [1 for i in range(10)]
await self.assert_query_result(
"""
insert Stuff {
content := 'Skies on Mars',
content2 := ' are red',
};
insert Stuff {
content := 'Skies on Earth',
content2 := ' are blue',
};
""" + qry,
[],
variables=dict(qv=qv),
)
await self.assert_query_result(
'''
select _ := ext::ai::to_context((select Stuff))
order by _
''',
[
'Skies on Earth are blue',
'Skies on Mars are red',
],
)
async for tr in self.try_until_succeeds(
ignore=(AssertionError,),
timeout=30.0,
):
async with tr:
await self.assert_query_result(
qry,
[
{
'content': 'Skies on Earth',
'content2': ' are blue',
'distance': 0.3675444679663241,
},
{
'content': 'Skies on Mars',
'content2': ' are red',
'distance': 0.4284523933505918,
},
],
variables=dict(qv=qv),
)
# updating an object should make it disappear from results.
# (the read is done in the same tx, so there is no possible
# race where the worker picks it up before the read)
async for tr in self.try_until_succeeds(
ignore=(
edgedb.TransactionConflictError,
edgedb.TransactionSerializationError,
),
timeout=30.0,
):
async with tr:
await self.assert_query_result(
"""
update Stuff filter .content like '%Earth'
set { content2 := ' are often grey' };
""" + qry,
[
{
'content': 'Skies on Mars',
'content2': ' are red',
'distance': 0.4284523933505918,
},
],
variables=dict(qv=qv),
)
finally:
await self.con.execute('''
delete Stuff;
''') | qv = [1 for i in range(10)]
await self.assert_query_result( | test_ext_ai_indexing_02 | python | geldata/gel | tests/test_ext_ai.py | https://github.com/geldata/gel/blob/master/tests/test_ext_ai.py | Apache-2.0 |
async def test_ext_ai_indexing_03(self):
try:
await self.con.execute(
"""
insert Star {
content := 'Skies on Mars are red'
};
insert Supernova {
content := 'Skies on Earth are blue'
};
""",
)
await self.assert_query_result(
'''
select _ := ext::ai::to_context((select Star))
order by _
''',
[
'Skies on Earth are blue',
'Skies on Mars are red',
],
)
async for tr in self.try_until_succeeds(
ignore=(AssertionError,),
timeout=30.0,
):
async with tr:
await self.assert_query_result(
r'''
with
result := ext::ai::search(
Star, <array<float32>>$qv)
select
result.object {
content,
distance := result.distance,
}
order by
result.distance asc empty last
then result.object.content
''',
[
{
'content': 'Skies on Earth are blue',
'distance': 0.3675444679663241,
},
{
'content': 'Skies on Mars are red',
'distance': 0.4284523933505918,
},
],
variables={
"qv": [1 for i in range(10)],
}
)
finally:
await self.con.execute('''
delete Star;
delete Supernova;
''') | insert Star {
content := 'Skies on Mars are red'
};
insert Supernova {
content := 'Skies on Earth are blue'
};
""",
)
await self.assert_query_result( | test_ext_ai_indexing_03 | python | geldata/gel | tests/test_ext_ai.py | https://github.com/geldata/gel/blob/master/tests/test_ext_ai.py | Apache-2.0 |
async def test_ext_ai_indexing_04(self):
qv = [1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0, 9.0, -10.0]
await self._assert_index_use(
f'''
with vector := <array<float32>>$0
select ext::ai::search(Stuff, vector) limit 5;
''',
qv,
)
await self._assert_index_use(
f'''
with vector := <array<float32>>$0
select ext::ai::search(Stuff, vector).object limit 5;
''',
qv,
)
await self._assert_index_use(
f'''
select ext::ai::search(Stuff, <array<float32>>$0) limit 5;
''',
qv,
)
await self._assert_index_use(
f'''
with vector := <array<float32>><json>$0
select ext::ai::search(Stuff, vector) limit 5;
''',
json.dumps(qv),
)
await self._assert_index_use(
f'''
select ext::ai::search(Stuff, <array<float32>><json>$0) limit 5;
''',
json.dumps(qv),
) | ,
qv,
)
await self._assert_index_use(
f | test_ext_ai_indexing_04 | python | geldata/gel | tests/test_ext_ai.py | https://github.com/geldata/gel/blob/master/tests/test_ext_ai.py | Apache-2.0 |
async def test_ext_ai_indexing_05(self):
try:
await self.con.execute(
"""
insert Astronomy {
content := 'Skies on Venus are orange'
};
insert Astronomy {
content := 'Skies on Mars are red'
};
insert Astronomy {
content := 'Skies on Pluto are black and starry'
};
insert Astronomy {
content := 'Skies on Earth are blue'
};
""",
)
async for tr in self.try_until_succeeds(
ignore=(AssertionError,),
timeout=30.0,
):
async with tr:
await self.assert_query_result(
r'''
with
result := ext::ai::search(
Astronomy, <array<float32>>$qv)
select
result.object {
content,
distance := result.distance,
}
order by
result.distance asc empty last
then result.object.content
''',
[
{
'content': (
'Skies on Pluto are black and starry'
),
'distance': 0.3545027756320972,
},
{
'content': 'Skies on Earth are blue',
'distance': 0.3675444679663241,
},
{
'content': 'Skies on Mars are red',
'distance': 0.4284523933505918,
},
{
'content': 'Skies on Venus are orange',
'distance': 0.4606401100294063,
},
],
variables={
"qv": [1 for i in range(10)],
}
)
finally:
await self.con.execute('''
delete Astronomy;
''') | insert Astronomy {
content := 'Skies on Venus are orange'
};
insert Astronomy {
content := 'Skies on Mars are red'
};
insert Astronomy {
content := 'Skies on Pluto are black and starry'
};
insert Astronomy {
content := 'Skies on Earth are blue'
};
""",
)
async for tr in self.try_until_succeeds(
ignore=(AssertionError,),
timeout=30.0,
):
async with tr:
await self.assert_query_result(
r | test_ext_ai_indexing_05 | python | geldata/gel | tests/test_ext_ai.py | https://github.com/geldata/gel/blob/master/tests/test_ext_ai.py | Apache-2.0 |
def test_sql_parse_select_00(self):
"""
SELECT * FROM my_table
""" | SELECT * FROM my_table | test_sql_parse_select_00 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_01(self):
"""
SELECT col1 FROM my_table WHERE
my_attribute LIKE 'condition' AND other = 5.6 AND extra > 5
% OK %
SELECT col1 FROM my_table WHERE
(((my_attribute LIKE 'condition') AND
(other = 5.6)) AND (extra > 5))
""" | SELECT col1 FROM my_table WHERE
my_attribute LIKE 'condition' AND other = 5.6 AND extra > 5
% OK %
SELECT col1 FROM my_table WHERE
(((my_attribute LIKE 'condition') AND
(other = 5.6)) AND (extra > 5)) | test_sql_parse_select_01 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_02(self):
"""
SELECT * FROM table_one JOIN table_two USING (common)
""" | SELECT * FROM table_one JOIN table_two USING (common) | test_sql_parse_select_02 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_03(self):
"""
WITH fake_table AS (
SELECT SUM(countable) AS total FROM inner_table
GROUP BY groupable
) SELECT * FROM fake_table
% OK %
WITH fake_table AS ((
SELECT sum(countable) AS total FROM inner_table
GROUP BY groupable
)) SELECT * FROM fake_table
""" | WITH fake_table AS (
SELECT SUM(countable) AS total FROM inner_table
GROUP BY groupable
) SELECT * FROM fake_table
% OK %
WITH fake_table AS ((
SELECT sum(countable) AS total FROM inner_table
GROUP BY groupable
)) SELECT * FROM fake_table | test_sql_parse_select_03 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_04(self):
"""
SELECT * FROM (SELECT something FROM dataset) AS other
""" | SELECT * FROM (SELECT something FROM dataset) AS other | test_sql_parse_select_04 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_05(self):
"""
SELECT a, CASE WHEN a=1 THEN 'one' WHEN a=2
THEN 'two' ELSE 'other' END FROM test
% OK %
SELECT a, (CASE WHEN (a = 1) THEN 'one' WHEN (a = 2)
THEN 'two' ELSE 'other' END) FROM test
""" | SELECT a, CASE WHEN a=1 THEN 'one' WHEN a=2
THEN 'two' ELSE 'other' END FROM test
% OK %
SELECT a, (CASE WHEN (a = 1) THEN 'one' WHEN (a = 2)
THEN 'two' ELSE 'other' END) FROM test | test_sql_parse_select_05 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_06(self):
"""
SELECT CASE a.value WHEN 0 THEN '1' ELSE '2' END
FROM sometable a
% OK %
SELECT (CASE a.value WHEN 0 THEN '1' ELSE '2' END)
FROM sometable AS a
""" | SELECT CASE a.value WHEN 0 THEN '1' ELSE '2' END
FROM sometable a
% OK %
SELECT (CASE a.value WHEN 0 THEN '1' ELSE '2' END)
FROM sometable AS a | test_sql_parse_select_06 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_07(self):
"""
SELECT * FROM table_one UNION select * FROM table_two
% OK %
(SELECT * FROM table_one) UNION (SELECT * FROM table_two)
""" | SELECT * FROM table_one UNION select * FROM table_two
% OK %
(SELECT * FROM table_one) UNION (SELECT * FROM table_two) | test_sql_parse_select_07 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_08(self):
"""
SELECT * FROM my_table WHERE ST_Intersects(geo1, geo2)
% OK %
SELECT * FROM my_table WHERE st_intersects(geo1, geo2)
""" | SELECT * FROM my_table WHERE ST_Intersects(geo1, geo2)
% OK %
SELECT * FROM my_table WHERE st_intersects(geo1, geo2) | test_sql_parse_select_08 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_09(self):
"""
SELECT 'accbf276-705b-11e7-b8e4-0242ac120002'::UUID
% OK %
SELECT ('accbf276-705b-11e7-b8e4-0242ac120002')::uuid
""" | SELECT 'accbf276-705b-11e7-b8e4-0242ac120002'::UUID
% OK %
SELECT ('accbf276-705b-11e7-b8e4-0242ac120002')::uuid | test_sql_parse_select_09 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_10(self):
"""
SELECT * FROM my_table ORDER BY field DESC NULLS FIRST
""" | SELECT * FROM my_table ORDER BY field DESC NULLS FIRST | test_sql_parse_select_10 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_11(self):
"""
SELECT * FROM my_table ORDER BY field
% OK %
SELECT * FROM my_table ORDER BY field ASC NULLS LAST
""" | SELECT * FROM my_table ORDER BY field
% OK %
SELECT * FROM my_table ORDER BY field ASC NULLS LAST | test_sql_parse_select_11 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_12(self):
"""
SELECT salary, sum(salary) OVER () FROM empsalary
""" | SELECT salary, sum(salary) OVER () FROM empsalary | test_sql_parse_select_12 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_13(self):
"""
SELECT salary, sum(salary)
OVER (ORDER BY salary) FROM empsalary
% OK %
SELECT salary, sum(salary)
OVER (ORDER BY salary ASC NULLS LAST) FROM empsalary
""" | SELECT salary, sum(salary)
OVER (ORDER BY salary) FROM empsalary
% OK %
SELECT salary, sum(salary)
OVER (ORDER BY salary ASC NULLS LAST) FROM empsalary | test_sql_parse_select_13 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_14(self):
"""
SELECT salary, avg(salary)
OVER (PARTITION BY depname) FROM empsalary
""" | SELECT salary, avg(salary)
OVER (PARTITION BY depname) FROM empsalary | test_sql_parse_select_14 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_15(self):
"""
SELECT m.* FROM mytable m WHERE m.foo IS NULL
% OK %
SELECT m.* FROM mytable AS m WHERE (m.foo IS NULL)
""" | SELECT m.* FROM mytable m WHERE m.foo IS NULL
% OK %
SELECT m.* FROM mytable AS m WHERE (m.foo IS NULL) | test_sql_parse_select_15 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_16(self):
"""
SELECT m.* FROM mytable m WHERE m.foo IS NOT NULL
% OK %
SELECT m.* FROM mytable AS m WHERE (m.foo IS NOT NULL)
""" | SELECT m.* FROM mytable m WHERE m.foo IS NOT NULL
% OK %
SELECT m.* FROM mytable AS m WHERE (m.foo IS NOT NULL) | test_sql_parse_select_16 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_17(self):
"""
SELECT m.* FROM mytable m WHERE m.foo IS TRUE
% OK %
SELECT m.* FROM mytable AS m WHERE (m.foo IS TRUE)
""" | SELECT m.* FROM mytable m WHERE m.foo IS TRUE
% OK %
SELECT m.* FROM mytable AS m WHERE (m.foo IS TRUE) | test_sql_parse_select_17 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_18(self):
"""
SELECT m.name AS mname, pname FROM manufacturers m,
LATERAL get_product_names(m.id) pname
% OK %
SELECT m.name AS mname, pname FROM manufacturers AS m,
LATERAL get_product_names(m.id) AS pname
""" | SELECT m.name AS mname, pname FROM manufacturers m,
LATERAL get_product_names(m.id) pname
% OK %
SELECT m.name AS mname, pname FROM manufacturers AS m,
LATERAL get_product_names(m.id) AS pname | test_sql_parse_select_18 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_19(self):
"""
SELECT * FROM unnest(ARRAY['a','b','c','d','e','f'])
% OK %
SELECT * FROM unnest(ARRAY['a', 'b', 'c', 'd', 'e', 'f'])
""" | SELECT * FROM unnest(ARRAY['a','b','c','d','e','f'])
% OK %
SELECT * FROM unnest(ARRAY['a', 'b', 'c', 'd', 'e', 'f']) | test_sql_parse_select_19 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_20(self):
"""
SELECT * FROM my_table
WHERE (a, b) in (('a', 'b'), ('c', 'd'))
% OK %
SELECT * FROM my_table
WHERE ((a, b) IN (('a', 'b'), ('c', 'd')))
""" | SELECT * FROM my_table
WHERE (a, b) in (('a', 'b'), ('c', 'd'))
% OK %
SELECT * FROM my_table
WHERE ((a, b) IN (('a', 'b'), ('c', 'd'))) | test_sql_parse_select_20 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_21(self):
"""
SELECT * FRO my_table
""" | SELECT * FRO my_table | test_sql_parse_select_21 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_22(self):
"""
SELECT a, CASE WHEN a=1 THEN 'one'
WHEN a=2 THEN ELSE 'other' END FROM test
""" | SELECT a, CASE WHEN a=1 THEN 'one'
WHEN a=2 THEN ELSE 'other' END FROM test | test_sql_parse_select_22 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_23(self):
"""
SELECT * FROM table_one, table_two
""" | SELECT * FROM table_one, table_two | test_sql_parse_select_23 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_24(self):
"""
SELECT * FROM table_one, public.table_one
""" | SELECT * FROM table_one, public.table_one | test_sql_parse_select_24 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_25(self):
"""
WITH fake_table AS (SELECT * FROM inner_table)
SELECT * FROM fake_table
% OK %
WITH fake_table AS ((SELECT * FROM inner_table))
SELECT * FROM fake_table
""" | WITH fake_table AS (SELECT * FROM inner_table)
SELECT * FROM fake_table
% OK %
WITH fake_table AS ((SELECT * FROM inner_table))
SELECT * FROM fake_table | test_sql_parse_select_25 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_26(self):
"""
SELECT * FROM table_one JOIN table_two USING (common_1)
JOIN table_three USING (common_2)
""" | SELECT * FROM table_one JOIN table_two USING (common_1)
JOIN table_three USING (common_2) | test_sql_parse_select_26 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_27(self):
"""
select * FROM table_one UNION select * FROM table_two
% OK %
(SELECT * FROM table_one) UNION (SELECT * FROM table_two)
""" | select * FROM table_one UNION select * FROM table_two
% OK %
(SELECT * FROM table_one) UNION (SELECT * FROM table_two) | test_sql_parse_select_27 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_28(self):
"""
SELECT * FROM my_table WHERE (a, b) in ('a', 'b')
% OK %
SELECT * FROM my_table WHERE ((a, b) IN ('a', 'b'))
""" | SELECT * FROM my_table WHERE (a, b) in ('a', 'b')
% OK %
SELECT * FROM my_table WHERE ((a, b) IN ('a', 'b')) | test_sql_parse_select_28 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_29(self):
"""
SELECT * FROM my_table
WHERE (a, b) in (('a', 'b'), ('c', 'd'))
% OK %
SELECT * FROM my_table
WHERE ((a, b) IN (('a', 'b'), ('c', 'd')))
""" | SELECT * FROM my_table
WHERE (a, b) in (('a', 'b'), ('c', 'd'))
% OK %
SELECT * FROM my_table
WHERE ((a, b) IN (('a', 'b'), ('c', 'd'))) | test_sql_parse_select_29 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_30(self):
"""
SELECT (SELECT * FROM table_one)
% OK %
SELECT ((SELECT * FROM table_one))
""" | SELECT (SELECT * FROM table_one)
% OK %
SELECT ((SELECT * FROM table_one)) | test_sql_parse_select_30 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_31(self):
"""
SELECT my_func((select * from table_one))
% OK %
SELECT my_func(((SELECT * FROM table_one)))
""" | SELECT my_func((select * from table_one))
% OK %
SELECT my_func(((SELECT * FROM table_one))) | test_sql_parse_select_31 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_32(self):
"""
SELECT 1
""" | SELECT 1 | test_sql_parse_select_32 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_33(self):
"""
SELECT 2
""" | SELECT 2 | test_sql_parse_select_33 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_34(self):
"""
SELECT $1
""" | SELECT $1 | test_sql_parse_select_34 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_35(self):
"""
SELECT 1; SELECT a FROM b
""" | SELECT 1; SELECT a FROM b | test_sql_parse_select_35 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_36(self):
"""
SELECT COUNT(DISTINCT id), * FROM targets
WHERE something IS NOT NULL
AND elsewhere::interval < now()
% OK %
SELECT count(DISTINCT id), * FROM targets
WHERE ((something IS NOT NULL)
AND ((elsewhere)::pg_catalog.interval < now()))
""" | SELECT COUNT(DISTINCT id), * FROM targets
WHERE something IS NOT NULL
AND elsewhere::interval < now()
% OK %
SELECT count(DISTINCT id), * FROM targets
WHERE ((something IS NOT NULL)
AND ((elsewhere)::pg_catalog.interval < now())) | test_sql_parse_select_36 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_37(self):
"""
SELECT b AS x, a AS y FROM z
""" | SELECT b AS x, a AS y FROM z | test_sql_parse_select_37 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_38(self):
"""
WITH a AS (SELECT * FROM x WHERE x.y = $1 AND x.z = 1)
SELECT * FROM a
% OK %
WITH a AS ((SELECT * FROM x WHERE ((x.y = $1) AND (x.z = 1))))
SELECT * FROM a
""" | WITH a AS (SELECT * FROM x WHERE x.y = $1 AND x.z = 1)
SELECT * FROM a
% OK %
WITH a AS ((SELECT * FROM x WHERE ((x.y = $1) AND (x.z = 1))))
SELECT * FROM a | test_sql_parse_select_38 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_39(self):
"""
SELECT * FROM x WHERE y IN ($1)
% OK %
SELECT * FROM x WHERE (y IN ($1))
""" | SELECT * FROM x WHERE y IN ($1)
% OK %
SELECT * FROM x WHERE (y IN ($1)) | test_sql_parse_select_39 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_40(self):
"""
SELECT * FROM x WHERE y IN ($1, $2, $3)
% OK %
SELECT * FROM x WHERE (y IN ($1, $2, $3))
""" | SELECT * FROM x WHERE y IN ($1, $2, $3)
% OK %
SELECT * FROM x WHERE (y IN ($1, $2, $3)) | test_sql_parse_select_40 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_41(self):
"""
SELECT * FROM x WHERE y IN ( $1::uuid )
% OK %
SELECT * FROM x WHERE (y IN (($1)::uuid))
""" | SELECT * FROM x WHERE y IN ( $1::uuid )
% OK %
SELECT * FROM x WHERE (y IN (($1)::uuid)) | test_sql_parse_select_41 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_42(self):
"""
SELECT * FROM x
WHERE y IN ( $1::uuid, $2::uuid, $3::uuid )
% OK %
SELECT * FROM x
WHERE (y IN (($1)::uuid, ($2)::uuid, ($3)::uuid))
""" | SELECT * FROM x
WHERE y IN ( $1::uuid, $2::uuid, $3::uuid )
% OK %
SELECT * FROM x
WHERE (y IN (($1)::uuid, ($2)::uuid, ($3)::uuid)) | test_sql_parse_select_42 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_43(self):
"""
SELECT * FROM x AS a, y AS b
""" | SELECT * FROM x AS a, y AS b | test_sql_parse_select_43 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_44(self):
"""
SELECT * FROM y AS a, x AS b
""" | SELECT * FROM y AS a, x AS b | test_sql_parse_select_44 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_45(self):
"""
SELECT x AS a, y AS b FROM x
""" | SELECT x AS a, y AS b FROM x | test_sql_parse_select_45 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_46(self):
"""
SELECT x, y FROM z
""" | SELECT x, y FROM z | test_sql_parse_select_46 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_47(self):
"""
SELECT y, x FROM z
""" | SELECT y, x FROM z | test_sql_parse_select_47 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_48(self):
"""
SELECT * FROM a
""" | SELECT * FROM a | test_sql_parse_select_48 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_49(self):
"""
SELECT * FROM a AS b
""" | SELECT * FROM a AS b | test_sql_parse_select_49 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_50(self):
"""
-- nothing
% OK %
""" | -- nothing
% OK % | test_sql_parse_select_50 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_51(self):
"""
SELECT INTERVAL (0) $2
% OK %
SELECT ($2)::pg_catalog.interval
""" | SELECT INTERVAL (0) $2
% OK %
SELECT ($2)::pg_catalog.interval | test_sql_parse_select_51 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_52(self):
"""
SELECT INTERVAL (2) $2
% OK %
SELECT ($2)::pg_catalog.interval
""" | SELECT INTERVAL (2) $2
% OK %
SELECT ($2)::pg_catalog.interval | test_sql_parse_select_52 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_53(self):
"""
SELECT * FROM t WHERE t.a IN (1, 2) AND t.b = 3
% OK %
SELECT * FROM t WHERE ((t.a IN (1, 2)) AND (t.b = 3))
""" | SELECT * FROM t WHERE t.a IN (1, 2) AND t.b = 3
% OK %
SELECT * FROM t WHERE ((t.a IN (1, 2)) AND (t.b = 3)) | test_sql_parse_select_53 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_54(self):
"""
SELECT * FROM t WHERE t.b = 3 AND t.a IN (1, 2)
% OK %
SELECT * FROM t WHERE ((t.b = 3) AND (t.a IN (1, 2)))
""" | SELECT * FROM t WHERE t.b = 3 AND t.a IN (1, 2)
% OK %
SELECT * FROM t WHERE ((t.b = 3) AND (t.a IN (1, 2))) | test_sql_parse_select_54 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_55(self):
"""
SELECT * FROM t WHERE a && '[1,2]'
% OK %
SELECT * FROM t WHERE (a && '[1,2]')
""" | SELECT * FROM t WHERE a && '[1,2]'
% OK %
SELECT * FROM t WHERE (a && '[1,2]') | test_sql_parse_select_55 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_56(self):
"""
SELECT * FROM t WHERE a && '[1,2]'::int4range
% OK %
SELECT * FROM t WHERE (a && ('[1,2]')::int4range)
""" | SELECT * FROM t WHERE a && '[1,2]'::int4range
% OK %
SELECT * FROM t WHERE (a && ('[1,2]')::int4range) | test_sql_parse_select_56 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_57(self):
"""
SELECT * FROM t_20210301_x
""" | SELECT * FROM t_20210301_x | test_sql_parse_select_57 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_58(self):
"""
SELECT (1.2 * 3.4)
""" | SELECT (1.2 * 3.4) | test_sql_parse_select_58 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_59(self):
"""
SELECT TRUE; SELECT FALSE
""" | SELECT TRUE; SELECT FALSE | test_sql_parse_select_59 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_60(self):
"""
SELECT -1; SELECT 0; SELECT 1
""" | SELECT -1; SELECT 0; SELECT 1 | test_sql_parse_select_60 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_select_61(self):
"""
SELECT a[1:3], b.x
% OK %
SELECT (a)[1:3], b.x
""" | SELECT a[1:3], b.x
% OK %
SELECT (a)[1:3], b.x | test_sql_parse_select_61 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_00(self):
"""
INSERT INTO my_table (id, name) VALUES (1, 'some')
""" | INSERT INTO my_table (id, name) VALUES (1, 'some') | test_sql_parse_insert_00 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_01(self):
"""
INSERT INTO my_table (id, name) SELECT 1, 'some'
% OK %
INSERT INTO my_table (id, name) ((SELECT 1, 'some'))
""" | INSERT INTO my_table (id, name) SELECT 1, 'some'
% OK %
INSERT INTO my_table (id, name) ((SELECT 1, 'some')) | test_sql_parse_insert_01 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_02(self):
"""
INSERT INTO my_table (id) VALUES (5) RETURNING id, date
""" | INSERT INTO my_table (id) VALUES (5) RETURNING id, date | test_sql_parse_insert_02 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_03(self):
"""
INSERT INTO my_table (id) VALUES (5) RETURNING id, "date"
% OK %
INSERT INTO my_table (id) VALUES (5) RETURNING id, date
""" | INSERT INTO my_table (id) VALUES (5) RETURNING id, "date"
% OK %
INSERT INTO my_table (id) VALUES (5) RETURNING id, date | test_sql_parse_insert_03 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_04(self):
"""
INSERT INTO my_table (id) VALUES(1); SELECT * FROM my_table
% OK %
INSERT INTO my_table (id) VALUES (1); SELECT * FROM my_table
""" | INSERT INTO my_table (id) VALUES(1); SELECT * FROM my_table
% OK %
INSERT INTO my_table (id) VALUES (1); SELECT * FROM my_table | test_sql_parse_insert_04 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_05(self):
"""
INSERT INTO my_table
""" | INSERT INTO my_table | test_sql_parse_insert_05 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_06(self):
"""
INSERT INTO table_one (id, name) SELECT * from table_two
% OK %
INSERT INTO table_one (id, name) ((SELECT * FROM table_two))
""" | INSERT INTO table_one (id, name) SELECT * from table_two
% OK %
INSERT INTO table_one (id, name) ((SELECT * FROM table_two)) | test_sql_parse_insert_06 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_07(self):
"""
WITH fake as (SELECT * FROM inner_table)
INSERT INTO dataset SELECT * FROM fake
% OK %
WITH fake AS ((SELECT * FROM inner_table))
INSERT INTO dataset ((SELECT * FROM fake))
""" | WITH fake as (SELECT * FROM inner_table)
INSERT INTO dataset SELECT * FROM fake
% OK %
WITH fake AS ((SELECT * FROM inner_table))
INSERT INTO dataset ((SELECT * FROM fake)) | test_sql_parse_insert_07 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_08(self):
"""
INSERT INTO test (a, b) VALUES
(ARRAY[$1, $1, $2, $3], $4::timestamptz),
(ARRAY[$1, $1, $2, $3], $4::timestamptz),
($5, $6::timestamptz)
% OK %
INSERT INTO test (a, b) VALUES
(ARRAY[$1, $1, $2, $3], ($4)::timestamptz),
(ARRAY[$1, $1, $2, $3], ($4)::timestamptz),
($5, ($6)::timestamptz)
""" | INSERT INTO test (a, b) VALUES
(ARRAY[$1, $1, $2, $3], $4::timestamptz),
(ARRAY[$1, $1, $2, $3], $4::timestamptz),
($5, $6::timestamptz)
% OK %
INSERT INTO test (a, b) VALUES
(ARRAY[$1, $1, $2, $3], ($4)::timestamptz),
(ARRAY[$1, $1, $2, $3], ($4)::timestamptz),
($5, ($6)::timestamptz) | test_sql_parse_insert_08 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_09(self):
"""
INSERT INTO films (code, title, did) VALUES
('UA502', 'Bananas', 105), ('T_601', 'Yojimbo', DEFAULT)
""" | INSERT INTO films (code, title, did) VALUES
('UA502', 'Bananas', 105), ('T_601', 'Yojimbo', DEFAULT) | test_sql_parse_insert_09 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_10(self):
"""
INSERT INTO films (code, title, did) VALUES ($1, $2, $3)
""" | INSERT INTO films (code, title, did) VALUES ($1, $2, $3) | test_sql_parse_insert_10 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_11(self):
"""
INSERT INTO films DEFAULT VALUES
ON CONFLICT DO UPDATE
SET (a, b) = ('a', 'b'), c = 'c', (d, e) = ('d', 'e')
""" | INSERT INTO films DEFAULT VALUES
ON CONFLICT DO UPDATE
SET (a, b) = ('a', 'b'), c = 'c', (d, e) = ('d', 'e') | test_sql_parse_insert_11 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_insert_12(self):
"""
INSERT INTO foo DEFAULT VALUES
RETURNING a[1:3] AS a, b.x AS b
% OK %
INSERT INTO foo DEFAULT VALUES
RETURNING (a)[1:3] AS a, b.x AS b
""" | INSERT INTO foo DEFAULT VALUES
RETURNING a[1:3] AS a, b.x AS b
% OK %
INSERT INTO foo DEFAULT VALUES
RETURNING (a)[1:3] AS a, b.x AS b | test_sql_parse_insert_12 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_00(self):
"""
UPDATE my_table SET the_value = DEFAULT
""" | UPDATE my_table SET the_value = DEFAULT | test_sql_parse_update_00 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_01(self):
"""
UPDATE tictactoe SET board[1:3][1:3] = '{{,,},{,,},{,,}}'
WHERE game = 1
% OK %
UPDATE tictactoe SET board[1:3][1:3] = '{{,,},{,,},{,,}}'
WHERE (game = 1)
""" | UPDATE tictactoe SET board[1:3][1:3] = '{{,,},{,,},{,,}}'
WHERE game = 1
% OK %
UPDATE tictactoe SET board[1:3][1:3] = '{{,,},{,,},{,,}}'
WHERE (game = 1) | test_sql_parse_update_01 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_02(self):
"""
UPDATE accounts SET
(contact_first_name, contact_last_name) =
(SELECT first_name, last_name
FROM salesmen WHERE salesmen.id = accounts.sales_id)
% OK %
UPDATE accounts SET
(contact_first_name, contact_last_name) =
((SELECT first_name, last_name
FROM salesmen WHERE (salesmen.id = accounts.sales_id)))
""" | UPDATE accounts SET
(contact_first_name, contact_last_name) =
(SELECT first_name, last_name
FROM salesmen WHERE salesmen.id = accounts.sales_id)
% OK %
UPDATE accounts SET
(contact_first_name, contact_last_name) =
((SELECT first_name, last_name
FROM salesmen WHERE (salesmen.id = accounts.sales_id))) | test_sql_parse_update_02 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_03(self):
"""
UPDATE my_table SET id = 5; DELETE FROM my_table
""" | UPDATE my_table SET id = 5; DELETE FROM my_table | test_sql_parse_update_03 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_04(self):
"""
UPDATE dataset SET a = 5
WHERE id IN (SELECT * from table_one)
OR age IN (select * from table_two)
% OK %
UPDATE dataset SET a = 5
WHERE (id = ANY ((SELECT * FROM table_one))
OR age = ANY ((SELECT * FROM table_two)))
""" | UPDATE dataset SET a = 5
WHERE id IN (SELECT * from table_one)
OR age IN (select * from table_two)
% OK %
UPDATE dataset SET a = 5
WHERE (id = ANY ((SELECT * FROM table_one))
OR age = ANY ((SELECT * FROM table_two))) | test_sql_parse_update_04 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_05(self):
"""
UPDATE dataset SET a = 5 FROM extra WHERE b = c
% OK %
UPDATE dataset SET a = 5 FROM extra WHERE (b = c)
""" | UPDATE dataset SET a = 5 FROM extra WHERE b = c
% OK %
UPDATE dataset SET a = 5 FROM extra WHERE (b = c) | test_sql_parse_update_05 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_06(self):
"""
UPDATE users SET one_thing = $1, second_thing = $2
WHERE users.id = $1
% OK %
UPDATE users SET one_thing = $1, second_thing = $2
WHERE (users.id = $1)
""" | UPDATE users SET one_thing = $1, second_thing = $2
WHERE users.id = $1
% OK %
UPDATE users SET one_thing = $1, second_thing = $2
WHERE (users.id = $1) | test_sql_parse_update_06 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_07(self):
"""
UPDATE users SET something_else = $1 WHERE users.id = $1
% OK %
UPDATE users SET something_else = $1 WHERE (users.id = $1)
""" | UPDATE users SET something_else = $1 WHERE users.id = $1
% OK %
UPDATE users SET something_else = $1 WHERE (users.id = $1) | test_sql_parse_update_07 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_08(self):
"""
UPDATE users SET something_else =
(SELECT a FROM x WHERE uid = users.id LIMIT 1)
WHERE users.id = $1
% OK %
UPDATE users SET something_else =
((SELECT a FROM x WHERE (uid = users.id) LIMIT 1))
WHERE (users.id = $1)
""" | UPDATE users SET something_else =
(SELECT a FROM x WHERE uid = users.id LIMIT 1)
WHERE users.id = $1
% OK %
UPDATE users SET something_else =
((SELECT a FROM x WHERE (uid = users.id) LIMIT 1))
WHERE (users.id = $1) | test_sql_parse_update_08 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_09(self):
"""
UPDATE x SET a = 1, b = 2, c = 3
""" | UPDATE x SET a = 1, b = 2, c = 3 | test_sql_parse_update_09 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_10(self):
"""
UPDATE x SET z = now()
""" | UPDATE x SET z = now() | test_sql_parse_update_10 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_11(self):
"""
UPDATE x SET (a, b) = ('a', 'b'), c = 'c', (d, e) = ('d', 'e')
""" | UPDATE x SET (a, b) = ('a', 'b'), c = 'c', (d, e) = ('d', 'e') | test_sql_parse_update_11 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_12(self):
"""
UPDATE tictactoe SET
(board[1:3][1:3], finished) = ('{{,,},{,,},{,,}}', FALSE)
""" | UPDATE tictactoe SET
(board[1:3][1:3], finished) = ('{{,,},{,,},{,,}}', FALSE) | test_sql_parse_update_12 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_update_13(self):
"""
UPDATE tictactoe SET a = a RETURNING *
""" | UPDATE tictactoe SET a = a RETURNING * | test_sql_parse_update_13 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_delete(self):
"""
DELETE FROM dataset USING table_one
WHERE x = y OR x IN (SELECT * from table_two)
% OK %
DELETE FROM dataset USING table_one
WHERE ((x = y) OR x = ANY ((SELECT * FROM table_two)))
""" | DELETE FROM dataset USING table_one
WHERE x = y OR x IN (SELECT * from table_two)
% OK %
DELETE FROM dataset USING table_one
WHERE ((x = y) OR x = ANY ((SELECT * FROM table_two))) | test_sql_parse_delete | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_transaction_00(self):
"""
BEGIN
""" | BEGIN | test_sql_parse_transaction_00 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_transaction_01(self):
"""
BEGIN TRANSACTION
% OK %
BEGIN
""" | BEGIN TRANSACTION
% OK %
BEGIN | test_sql_parse_transaction_01 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_transaction_02(self):
"""
BEGIN ISOLATION LEVEL REPEATABLE READ READ ONLY DEFERRABLE
""" | BEGIN ISOLATION LEVEL REPEATABLE READ READ ONLY DEFERRABLE | test_sql_parse_transaction_02 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_transaction_03(self):
"""
START TRANSACTION
""" | START TRANSACTION | test_sql_parse_transaction_03 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_transaction_04(self):
"""
START TRANSACTION ISOLATION LEVEL REPEATABLE READ
""" | START TRANSACTION ISOLATION LEVEL REPEATABLE READ | test_sql_parse_transaction_04 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
def test_sql_parse_transaction_05(self):
"""
START TRANSACTION ISOLATION LEVEL READ COMMITTED
""" | START TRANSACTION ISOLATION LEVEL READ COMMITTED | test_sql_parse_transaction_05 | python | geldata/gel | tests/test_sql_parse.py | https://github.com/geldata/gel/blob/master/tests/test_sql_parse.py | Apache-2.0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.