mirror of
https://github.com/maxkratz/edgedb.git
synced 2024-09-16 18:59:05 +00:00
Fix non-rewritten tuple literals (#6521)
This commit is contained in:
parent
750f936551
commit
5838aaa6a5
2 changed files with 28 additions and 0 deletions
|
@ -964,6 +964,7 @@ def process_insert_rewrites(
|
|||
val = pathctx.get_path_var(
|
||||
rew_stmt, e.path_id, aspect='value', env=ctx.env
|
||||
)
|
||||
val = output.output_as_value(val, env=ctx.env)
|
||||
rew_stmt.target_list.append(pgast.ResTarget(
|
||||
name=ptr_info.column_name, val=val))
|
||||
|
||||
|
|
|
@ -1047,3 +1047,30 @@ class TestRewrites(tb.QueryTestCase):
|
|||
'select Foo { will_be_true }',
|
||||
[{'will_be_true': True}]
|
||||
)
|
||||
|
||||
async def test_edgeql_rewrites_28(self):
|
||||
await self.con.execute(
|
||||
'''
|
||||
create type Address {
|
||||
create property coordinates: tuple<lat: float32, lng: float32>;
|
||||
create property updated_at: str {
|
||||
create rewrite insert using ('now')
|
||||
};
|
||||
};
|
||||
insert Address {
|
||||
coordinates := (
|
||||
lat := <std::float32>40.07987,
|
||||
lng := <std::float32>20.56509
|
||||
)
|
||||
};
|
||||
'''
|
||||
)
|
||||
await self.assert_query_result(
|
||||
'select Address { coordinates, updated_at }',
|
||||
[
|
||||
{
|
||||
'coordinates': {'lat': 40.07987, 'lng': 20.56509},
|
||||
'updated_at': 'now'
|
||||
}
|
||||
]
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue