From 3cd967d1a3cf0212ea5193a0d330207ce07df8b9 Mon Sep 17 00:00:00 2001 From: Nik Sidnev Date: Thu, 25 Aug 2022 18:29:48 +0300 Subject: [PATCH] implement generation of EdgeQL queries modules --- .credo.exs | 10 +- .formatter.exs | 1 + .github/workflows/tests.yml | 7 +- .gitignore | 2 +- CHANGELOG.md | 5 + config/config.exs | 7 + edgedb.toml | 2 +- lib/edgedb.ex | 37 +- lib/edgedb/connection.ex | 79 +-- lib/edgedb/connection/config.ex | 4 +- lib/edgedb/connection/config/dsn.ex | 3 +- lib/edgedb/connection/config/validation.ex | 9 +- lib/edgedb/edgeql/generator.ex | 437 +++++++++++++ lib/edgedb/edgeql/generator/args.ex | 104 +++ lib/edgedb/edgeql/generator/array.ex | 68 ++ lib/edgedb/edgeql/generator/enum.ex | 60 ++ lib/edgedb/edgeql/generator/handler.ex | 27 + lib/edgedb/edgeql/generator/named_tuple.ex | 101 +++ lib/edgedb/edgeql/generator/object.ex | 258 ++++++++ lib/edgedb/edgeql/generator/query.ex | 101 +++ lib/edgedb/edgeql/generator/range.ex | 54 ++ lib/edgedb/edgeql/generator/render.ex | 25 + lib/edgedb/edgeql/generator/scalar.ex | 52 ++ lib/edgedb/edgeql/generator/set.ex | 81 +++ lib/edgedb/edgeql/generator/shape.ex | 124 ++++ lib/edgedb/edgeql/generator/tuple.ex | 77 +++ lib/edgedb/error.ex | 9 +- lib/edgedb/protocol/codecs/bigint.ex | 8 +- lib/edgedb/protocol/codecs/bool.ex | 4 +- lib/edgedb/protocol/codecs/bytes.ex | 4 +- lib/edgedb/protocol/codecs/config_memory.ex | 4 +- lib/edgedb/protocol/codecs/date_duration.ex | 4 +- lib/edgedb/protocol/codecs/datetime.ex | 4 +- lib/edgedb/protocol/codecs/decimal.ex | 4 +- lib/edgedb/protocol/codecs/duration.ex | 4 +- lib/edgedb/protocol/codecs/enum.ex | 21 +- lib/edgedb/protocol/codecs/float32.ex | 4 +- lib/edgedb/protocol/codecs/float64.ex | 4 +- lib/edgedb/protocol/codecs/int16.ex | 4 +- lib/edgedb/protocol/codecs/int32.ex | 4 +- lib/edgedb/protocol/codecs/int64.ex | 4 +- lib/edgedb/protocol/codecs/local_date.ex | 4 +- lib/edgedb/protocol/codecs/local_datetime.ex | 4 +- lib/edgedb/protocol/codecs/local_time.ex | 4 +- lib/edgedb/protocol/codecs/multi_range.ex | 4 +- lib/edgedb/protocol/codecs/named_tuple.ex | 4 +- lib/edgedb/protocol/codecs/object.ex | 12 +- .../protocol/codecs/relative_duration.ex | 4 +- lib/edgedb/protocol/codecs/set.ex | 4 +- lib/edgedb/protocol/codecs/str.ex | 4 +- lib/edgedb/protocol/codecs/uuid.ex | 8 +- lib/edgedb/protocol/codecs/vector.ex | 4 +- lib/edgedb/query.ex | 8 +- lib/edgedb/result.ex | 2 + lib/edgedb/sandbox.ex | 10 +- lib/edgedb/types/named_tuple.ex | 12 +- lib/mix/edgedb/generate.ex | 114 ++++ mix.exs | 25 +- mix.lock | 3 +- pages/md/codegen.md | 87 +++ pages/md/main.md | 5 - pages/rst/api/api.rst | 37 +- pages/rst/api/edgedb-types.rst | 4 +- pages/rst/codegen.rst | 92 +++ pages/rst/index.rst | 8 +- priv/codegen/templates/handlers/_array.eex | 3 + priv/codegen/templates/handlers/_enum.eex | 5 + priv/codegen/templates/handlers/_execute.eex | 4 + priv/codegen/templates/handlers/_link.eex | 10 + priv/codegen/templates/handlers/_multi.eex | 12 + .../templates/handlers/_named_tuple.eex | 12 + priv/codegen/templates/handlers/_object.eex | 13 + priv/codegen/templates/handlers/_property.eex | 14 + .../templates/handlers/_required_single.eex | 12 + priv/codegen/templates/handlers/_set.eex | 4 + priv/codegen/templates/handlers/_shape.eex | 15 + priv/codegen/templates/handlers/_single.eex | 11 + priv/codegen/templates/handlers/_tuple.eex | 17 + priv/codegen/templates/modules/_args.eex | 1 + priv/codegen/templates/modules/_link.eex | 1 + priv/codegen/templates/modules/_object.eex | 35 + priv/codegen/templates/modules/query.ex.eex | 143 ++++ priv/codegen/templates/typespecs/_arg.eex | 5 + priv/codegen/templates/typespecs/_args.eex | 1 + .../templates/typespecs/_args_keyword.eex | 1 + .../codegen/templates/typespecs/_args_map.eex | 5 + priv/codegen/templates/typespecs/_array.eex | 1 + priv/codegen/templates/typespecs/_enum.eex | 5 + priv/codegen/templates/typespecs/_link.eex | 9 + .../templates/typespecs/_named_tuple.eex | 5 + priv/codegen/templates/typespecs/_object.eex | 1 + .../codegen/templates/typespecs/_property.eex | 9 + .../templates/typespecs/_query_pure.eex | 6 + priv/codegen/templates/typespecs/_range.eex | 5 + priv/codegen/templates/typespecs/_scalar.eex | 5 + priv/codegen/templates/typespecs/_set.eex | 1 + priv/codegen/templates/typespecs/_shape.eex | 11 + priv/codegen/templates/typespecs/_tuple.eex | 1 + priv/scripts/drop-roles.sh | 5 - priv/scripts/setup-roles.sh | 5 - test/codegen/codegen_test.exs | 95 +++ test/edgedb/api_test.exs | 3 +- test/edgedb/connection/state_test.exs | 5 +- test/edgedb/pool/edgedb_pool_test.exs | 10 +- test/edgedb/protocol/codecs/bigint_test.exs | 4 +- test/edgedb/protocol/codecs/bool_test.exs | 4 +- test/edgedb/protocol/codecs/bytes_test.exs | 4 +- .../protocol/codecs/config_memory_test.exs | 8 +- test/edgedb/protocol/codecs/decimal_test.exs | 4 +- test/edgedb/protocol/codecs/enum_test.exs | 4 +- test/edgedb/protocol/codecs/float32_test.exs | 4 +- test/edgedb/protocol/codecs/float64_test.exs | 4 +- test/edgedb/protocol/codecs/int16_test.exs | 12 +- test/edgedb/protocol/codecs/int32_test.exs | 12 +- test/edgedb/protocol/codecs/int64_test.exs | 12 +- test/edgedb/protocol/codecs/range_test.exs | 6 +- test/edgedb/protocol/codecs/str_test.exs | 4 +- test/edgedb/protocol/codecs/tuple_test.exs | 8 +- test/edgedb/types/named_tuple_test.exs | 4 +- test/shared/connection_test.exs | 8 +- test/support/codecs/ticket_no.ex | 4 +- .../edgeql/primitives/array/literal.edgeql | 1 + .../primitives/array/literal.edgeql.ex.assert | 56 ++ .../primitives/array/named.optional.edgeql | 1 + .../array/named.optional.edgeql.ex.assert | 62 ++ .../primitives/array/named.required.edgeql | 1 + .../array/named.required.edgeql.ex.assert | 62 ++ .../array/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../array/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../edgeql/primitives/enum/literal.edgeql | 1 + .../primitives/enum/literal.edgeql.ex.assert | 72 +++ .../primitives/enum/named.optional.edgeql | 1 + .../enum/named.optional.edgeql.ex.assert | 80 +++ .../primitives/enum/named.required.edgeql | 1 + .../enum/named.required.edgeql.ex.assert | 78 +++ .../enum/positional.optional.edgeql | 1 + .../enum/positional.optional.edgeql.ex.assert | 79 +++ .../enum/positional.required.edgeql | 1 + .../enum/positional.required.edgeql.ex.assert | 77 +++ .../range/cal/local_date/multi/literal.edgeql | 1 + .../local_date/multi/literal.edgeql.ex.assert | 56 ++ .../local_date/multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../local_date/multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../cal/local_date/single/literal.edgeql | 1 + .../single/literal.edgeql.ex.assert | 56 ++ .../local_date/single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../local_date/single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../cal/local_datetime/multi/literal.edgeql | 1 + .../multi/literal.edgeql.ex.assert | 56 ++ .../multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../cal/local_datetime/single/literal.edgeql | 1 + .../single/literal.edgeql.ex.assert | 56 ++ .../single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/datetime/multi/literal.edgeql | 1 + .../datetime/multi/literal.edgeql.ex.assert | 56 ++ .../datetime/multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../datetime/multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../datetime/multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../datetime/multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/datetime/single/literal.edgeql | 1 + .../datetime/single/literal.edgeql.ex.assert | 56 ++ .../datetime/single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../datetime/single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/decimal/multi/literal.edgeql | 1 + .../decimal/multi/literal.edgeql.ex.assert | 56 ++ .../range/decimal/multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../range/decimal/multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../decimal/multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../decimal/multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/decimal/single/literal.edgeql | 1 + .../decimal/single/literal.edgeql.ex.assert | 56 ++ .../decimal/single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../decimal/single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../decimal/single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../decimal/single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/float32/multi/literal.edgeql | 1 + .../float32/multi/literal.edgeql.ex.assert | 56 ++ .../range/float32/multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../range/float32/multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../float32/multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../float32/multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/float32/single/literal.edgeql | 1 + .../float32/single/literal.edgeql.ex.assert | 56 ++ .../float32/single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../float32/single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../float32/single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../float32/single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/float64/multi/literal.edgeql | 1 + .../float64/multi/literal.edgeql.ex.assert | 56 ++ .../range/float64/multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../range/float64/multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../float64/multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../float64/multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/float64/single/literal.edgeql | 1 + .../float64/single/literal.edgeql.ex.assert | 56 ++ .../float64/single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../float64/single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../float64/single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../float64/single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/int32/multi/literal.edgeql | 1 + .../int32/multi/literal.edgeql.ex.assert | 56 ++ .../range/int32/multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../range/int32/multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../int32/multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../int32/multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/int32/single/literal.edgeql | 1 + .../int32/single/literal.edgeql.ex.assert | 56 ++ .../range/int32/single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../range/int32/single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../int32/single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../int32/single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/int64/multi/literal.edgeql | 1 + .../int64/multi/literal.edgeql.ex.assert | 56 ++ .../range/int64/multi/named.optional.edgeql | 1 + .../multi/named.optional.edgeql.ex.assert | 62 ++ .../range/int64/multi/named.required.edgeql | 1 + .../multi/named.required.edgeql.ex.assert | 62 ++ .../int64/multi/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../int64/multi/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../range/int64/single/literal.edgeql | 1 + .../int64/single/literal.edgeql.ex.assert | 56 ++ .../range/int64/single/named.optional.edgeql | 1 + .../single/named.optional.edgeql.ex.assert | 62 ++ .../range/int64/single/named.required.edgeql | 1 + .../single/named.required.edgeql.ex.assert | 62 ++ .../int64/single/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../int64/single/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../scalars/bigint/custom/literal.edgeql | 1 + .../bigint/custom/literal.edgeql.ex.assert | 63 ++ .../bigint/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../bigint/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../bigint/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../bigint/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/bigint/std/literal.edgeql | 1 + .../bigint/std/literal.edgeql.ex.assert | 56 ++ .../scalars/bigint/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/bigint/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../bigint/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../bigint/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/bool/custom/literal.edgeql | 1 + .../bool/custom/literal.edgeql.ex.assert | 63 ++ .../scalars/bool/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../scalars/bool/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../bool/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../bool/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/bool/std/literal.edgeql | 1 + .../scalars/bool/std/literal.edgeql.ex.assert | 56 ++ .../scalars/bool/std/named.optional.edgeql | 1 + .../bool/std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/bool/std/named.required.edgeql | 1 + .../bool/std/named.required.edgeql.ex.assert | 62 ++ .../bool/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../bool/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/bytes/custom/literal.edgeql | 1 + .../bytes/custom/literal.edgeql.ex.assert | 63 ++ .../bytes/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../bytes/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../bytes/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../bytes/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/bytes/std/literal.edgeql | 1 + .../bytes/std/literal.edgeql.ex.assert | 56 ++ .../scalars/bytes/std/named.optional.edgeql | 1 + .../bytes/std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/bytes/std/named.required.edgeql | 1 + .../bytes/std/named.required.edgeql.ex.assert | 62 ++ .../bytes/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../bytes/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../cal/date_duration/custom/literal.edgeql | 1 + .../custom/literal.edgeql.ex.assert | 63 ++ .../custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../cal/date_duration/std/literal.edgeql | 1 + .../std/literal.edgeql.ex.assert | 56 ++ .../date_duration/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../date_duration/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../cal/local_date/custom/literal.edgeql | 1 + .../custom/literal.edgeql.ex.assert | 63 ++ .../local_date/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../local_date/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/cal/local_date/std/literal.edgeql | 1 + .../local_date/std/literal.edgeql.ex.assert | 56 ++ .../cal/local_date/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../cal/local_date/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../local_date/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../local_date/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../cal/local_datetime/custom/literal.edgeql | 1 + .../custom/literal.edgeql.ex.assert | 63 ++ .../custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../cal/local_datetime/std/literal.edgeql | 1 + .../std/literal.edgeql.ex.assert | 56 ++ .../local_datetime/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../local_datetime/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../cal/local_time/custom/literal.edgeql | 1 + .../custom/literal.edgeql.ex.assert | 63 ++ .../local_time/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../local_time/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/cal/local_time/std/literal.edgeql | 1 + .../local_time/std/literal.edgeql.ex.assert | 56 ++ .../cal/local_time/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../cal/local_time/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../local_time/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../local_time/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../relative_duration/custom/literal.edgeql | 1 + .../custom/literal.edgeql.ex.assert | 63 ++ .../custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../cal/relative_duration/std/literal.edgeql | 1 + .../std/literal.edgeql.ex.assert | 56 ++ .../std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/cfg/memory/custom/literal.edgeql | 1 + .../memory/custom/literal.edgeql.ex.assert | 63 ++ .../cfg/memory/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../cfg/memory/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../memory/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../memory/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/cfg/memory/std/literal.edgeql | 1 + .../cfg/memory/std/literal.edgeql.ex.assert | 56 ++ .../cfg/memory/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../cfg/memory/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../cfg/memory/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../cfg/memory/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/datetime/custom/literal.edgeql | 1 + .../datetime/custom/literal.edgeql.ex.assert | 63 ++ .../datetime/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../datetime/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/datetime/std/literal.edgeql | 1 + .../datetime/std/literal.edgeql.ex.assert | 56 ++ .../datetime/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../datetime/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../datetime/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../datetime/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/decimal/custom/literal.edgeql | 1 + .../decimal/custom/literal.edgeql.ex.assert | 63 ++ .../decimal/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../decimal/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../decimal/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../decimal/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/decimal/std/literal.edgeql | 1 + .../decimal/std/literal.edgeql.ex.assert | 56 ++ .../scalars/decimal/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/decimal/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../decimal/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../decimal/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/duration/custom/literal.edgeql | 1 + .../duration/custom/literal.edgeql.ex.assert | 63 ++ .../duration/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../duration/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/duration/std/literal.edgeql | 1 + .../duration/std/literal.edgeql.ex.assert | 63 ++ .../duration/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 69 ++ .../duration/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 69 ++ .../duration/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 68 ++ .../duration/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/float32/custom/literal.edgeql | 1 + .../float32/custom/literal.edgeql.ex.assert | 63 ++ .../float32/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../float32/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../float32/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../float32/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/float32/std/literal.edgeql | 1 + .../float32/std/literal.edgeql.ex.assert | 56 ++ .../scalars/float32/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/float32/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../float32/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../float32/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/float64/custom/literal.edgeql | 1 + .../float64/custom/literal.edgeql.ex.assert | 63 ++ .../float64/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../float64/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../float64/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../float64/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/float64/std/literal.edgeql | 1 + .../float64/std/literal.edgeql.ex.assert | 56 ++ .../scalars/float64/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/float64/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 62 ++ .../float64/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../float64/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/int16/custom/literal.edgeql | 1 + .../int16/custom/literal.edgeql.ex.assert | 63 ++ .../int16/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../int16/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../int16/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../int16/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/int16/std/literal.edgeql | 1 + .../int16/std/literal.edgeql.ex.assert | 56 ++ .../scalars/int16/std/named.optional.edgeql | 1 + .../int16/std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/int16/std/named.required.edgeql | 1 + .../int16/std/named.required.edgeql.ex.assert | 62 ++ .../int16/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../int16/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/int32/custom/literal.edgeql | 1 + .../int32/custom/literal.edgeql.ex.assert | 63 ++ .../int32/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../int32/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../int32/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../int32/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/int32/std/literal.edgeql | 1 + .../int32/std/literal.edgeql.ex.assert | 56 ++ .../scalars/int32/std/named.optional.edgeql | 1 + .../int32/std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/int32/std/named.required.edgeql | 1 + .../int32/std/named.required.edgeql.ex.assert | 62 ++ .../int32/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../int32/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/int64/custom/literal.edgeql | 1 + .../int64/custom/literal.edgeql.ex.assert | 63 ++ .../int64/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../int64/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../int64/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../int64/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/int64/std/literal.edgeql | 1 + .../int64/std/literal.edgeql.ex.assert | 56 ++ .../scalars/int64/std/named.optional.edgeql | 1 + .../int64/std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/int64/std/named.required.edgeql | 1 + .../int64/std/named.required.edgeql.ex.assert | 62 ++ .../int64/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../int64/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/json/custom/literal.edgeql | 1 + .../json/custom/literal.edgeql.ex.assert | 63 ++ .../scalars/json/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../scalars/json/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../json/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../json/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/json/std/literal.edgeql | 1 + .../scalars/json/std/literal.edgeql.ex.assert | 63 ++ .../scalars/json/std/named.optional.edgeql | 1 + .../json/std/named.optional.edgeql.ex.assert | 69 ++ .../scalars/json/std/named.required.edgeql | 1 + .../json/std/named.required.edgeql.ex.assert | 69 ++ .../json/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 68 ++ .../json/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 68 ++ .../scalars/str/custom/literal.edgeql | 1 + .../str/custom/literal.edgeql.ex.assert | 63 ++ .../scalars/str/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../scalars/str/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../str/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../str/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../primitives/scalars/str/std/literal.edgeql | 1 + .../scalars/str/std/literal.edgeql.ex.assert | 56 ++ .../scalars/str/std/named.optional.edgeql | 1 + .../str/std/named.optional.edgeql.ex.assert | 62 ++ .../scalars/str/std/named.required.edgeql | 1 + .../str/std/named.required.edgeql.ex.assert | 62 ++ .../str/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 61 ++ .../str/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 61 ++ .../scalars/uuid/custom/literal.edgeql | 1 + .../uuid/custom/literal.edgeql.ex.assert | 63 ++ .../scalars/uuid/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../scalars/uuid/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../uuid/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../uuid/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../scalars/uuid/std/literal.edgeql | 1 + .../scalars/uuid/std/literal.edgeql.ex.assert | 63 ++ .../scalars/uuid/std/named.optional.edgeql | 1 + .../uuid/std/named.optional.edgeql.ex.assert | 69 ++ .../scalars/uuid/std/named.required.edgeql | 1 + .../uuid/std/named.required.edgeql.ex.assert | 69 ++ .../uuid/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 68 ++ .../uuid/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 68 ++ .../primitives/sequence/custom/literal.edgeql | 1 + .../sequence/custom/literal.edgeql.ex.assert | 63 ++ .../sequence/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../sequence/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../primitives/tuple/named/literal.edgeql | 1 + .../tuple/named/literal.edgeql.ex.assert | 64 ++ .../tuple/named/named.optional.edgeql | 1 + .../named/named.optional.edgeql.ex.assert | 72 +++ .../tuple/named/named.required.edgeql | 1 + .../named/named.required.edgeql.ex.assert | 70 ++ .../tuple/named/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 71 ++ .../tuple/named/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 69 ++ .../primitives/tuple/unnamed/literal.edgeql | 1 + .../tuple/unnamed/literal.edgeql.ex.assert | 56 ++ .../tuple/unnamed/named.optional.edgeql | 1 + .../unnamed/named.optional.edgeql.ex.assert | 62 ++ .../tuple/unnamed/named.required.edgeql | 1 + .../unnamed/named.required.edgeql.ex.assert | 62 ++ .../tuple/unnamed/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 61 ++ .../tuple/unnamed/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 61 ++ .../primitives/vector/custom/literal.edgeql | 1 + .../vector/custom/literal.edgeql.ex.assert | 63 ++ .../vector/custom/named.optional.edgeql | 1 + .../custom/named.optional.edgeql.ex.assert | 69 ++ .../vector/custom/named.required.edgeql | 1 + .../custom/named.required.edgeql.ex.assert | 69 ++ .../vector/custom/positional.optional.edgeql | 1 + .../positional.optional.edgeql.ex.assert | 68 ++ .../vector/custom/positional.required.edgeql | 1 + .../positional.required.edgeql.ex.assert | 68 ++ .../primitives/vector/std/literal.edgeql | 1 + .../vector/std/literal.edgeql.ex.assert | 63 ++ .../vector/std/named.optional.edgeql | 1 + .../std/named.optional.edgeql.ex.assert | 69 ++ .../vector/std/named.required.edgeql | 1 + .../std/named.required.edgeql.ex.assert | 69 ++ .../vector/std/positional.optional.edgeql | 1 + .../std/positional.optional.edgeql.ex.assert | 68 ++ .../vector/std/positional.required.edgeql | 1 + .../std/positional.required.edgeql.ex.assert | 68 ++ .../codegen/edgeql/types/insert/basic.edgeql | 4 + .../types/insert/basic.edgeql.ex.assert | 85 +++ .../codegen/edgeql/types/select/basic.edgeql | 4 + .../types/select/basic.edgeql.ex.assert | 100 +++ .../types/select/links/convertors.edgeql | 16 + .../select/links/convertors.edgeql.ex.assert | 269 ++++++++ .../edgeql/types/select/links/multi.edgeql | 8 + .../types/select/links/multi.edgeql.ex.assert | 131 ++++ .../edgeql/types/select/links/nested.edgeql | 10 + .../select/links/nested.edgeql.ex.assert | 157 +++++ .../edgeql/types/select/links/optional.edgeql | 5 + .../select/links/optional.edgeql.ex.assert | 105 +++ .../edgeql/types/select/links/required.edgeql | 5 + .../select/links/required.edgeql.ex.assert | 105 +++ .../codegen/edgeql/types/select/multi.edgeql | 3 + .../types/select/multi.edgeql.ex.assert | 86 +++ .../types/select/required_single.edgeql | 3 + .../select/required_single.edgeql.ex.assert | 84 +++ .../codegen/edgeql/types/select/single.edgeql | 4 + .../types/select/single.edgeql.ex.assert | 87 +++ test/support/edgedb_case.ex | 5 +- .../support}/schema/migrations/00001.edgeql | 0 .../support}/schema/migrations/00002.edgeql | 0 .../support}/schema/migrations/00003.edgeql | 0 .../support}/schema/migrations/00004.edgeql | 0 test/support/schema/migrations/00005.edgeql | 485 ++++++++++++++ {priv/edgedb => test/support}/schema/v1.esdl | 0 {priv/edgedb => test/support}/schema/v2.esdl | 0 {priv/edgedb => test/support}/schema/v3.esdl | 0 {priv/edgedb => test/support}/schema/v4.esdl | 0 test/support/schema/v4_codegen.esdl | 610 ++++++++++++++++++ test/support/scripts/drop-roles.sh | 5 + .../support}/scripts/edgedb_docs.exs | 6 + .../support}/scripts/edgeql/drop-roles.edgeql | 0 .../scripts/edgeql/setup-roles.edgeql | 0 test/support/scripts/setup-roles.sh | 5 + 787 files changed, 25336 insertions(+), 319 deletions(-) create mode 100644 lib/edgedb/edgeql/generator.ex create mode 100644 lib/edgedb/edgeql/generator/args.ex create mode 100644 lib/edgedb/edgeql/generator/array.ex create mode 100644 lib/edgedb/edgeql/generator/enum.ex create mode 100644 lib/edgedb/edgeql/generator/handler.ex create mode 100644 lib/edgedb/edgeql/generator/named_tuple.ex create mode 100644 lib/edgedb/edgeql/generator/object.ex create mode 100644 lib/edgedb/edgeql/generator/query.ex create mode 100644 lib/edgedb/edgeql/generator/range.ex create mode 100644 lib/edgedb/edgeql/generator/render.ex create mode 100644 lib/edgedb/edgeql/generator/scalar.ex create mode 100644 lib/edgedb/edgeql/generator/set.ex create mode 100644 lib/edgedb/edgeql/generator/shape.ex create mode 100644 lib/edgedb/edgeql/generator/tuple.ex create mode 100644 lib/mix/edgedb/generate.ex create mode 100644 pages/md/codegen.md create mode 100644 pages/rst/codegen.rst create mode 100644 priv/codegen/templates/handlers/_array.eex create mode 100644 priv/codegen/templates/handlers/_enum.eex create mode 100644 priv/codegen/templates/handlers/_execute.eex create mode 100644 priv/codegen/templates/handlers/_link.eex create mode 100644 priv/codegen/templates/handlers/_multi.eex create mode 100644 priv/codegen/templates/handlers/_named_tuple.eex create mode 100644 priv/codegen/templates/handlers/_object.eex create mode 100644 priv/codegen/templates/handlers/_property.eex create mode 100644 priv/codegen/templates/handlers/_required_single.eex create mode 100644 priv/codegen/templates/handlers/_set.eex create mode 100644 priv/codegen/templates/handlers/_shape.eex create mode 100644 priv/codegen/templates/handlers/_single.eex create mode 100644 priv/codegen/templates/handlers/_tuple.eex create mode 100644 priv/codegen/templates/modules/_args.eex create mode 100644 priv/codegen/templates/modules/_link.eex create mode 100644 priv/codegen/templates/modules/_object.eex create mode 100644 priv/codegen/templates/modules/query.ex.eex create mode 100644 priv/codegen/templates/typespecs/_arg.eex create mode 100644 priv/codegen/templates/typespecs/_args.eex create mode 100644 priv/codegen/templates/typespecs/_args_keyword.eex create mode 100644 priv/codegen/templates/typespecs/_args_map.eex create mode 100644 priv/codegen/templates/typespecs/_array.eex create mode 100644 priv/codegen/templates/typespecs/_enum.eex create mode 100644 priv/codegen/templates/typespecs/_link.eex create mode 100644 priv/codegen/templates/typespecs/_named_tuple.eex create mode 100644 priv/codegen/templates/typespecs/_object.eex create mode 100644 priv/codegen/templates/typespecs/_property.eex create mode 100644 priv/codegen/templates/typespecs/_query_pure.eex create mode 100644 priv/codegen/templates/typespecs/_range.eex create mode 100644 priv/codegen/templates/typespecs/_scalar.eex create mode 100644 priv/codegen/templates/typespecs/_set.eex create mode 100644 priv/codegen/templates/typespecs/_shape.eex create mode 100644 priv/codegen/templates/typespecs/_tuple.eex delete mode 100755 priv/scripts/drop-roles.sh delete mode 100755 priv/scripts/setup-roles.sh create mode 100644 test/codegen/codegen_test.exs create mode 100644 test/support/codegen/edgeql/primitives/array/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/array/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/array/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/array/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/array/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/array/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/array/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/array/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/array/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/array/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/enum/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/enum/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/enum/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/enum/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/enum/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/enum/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/enum/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/enum/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/std/literal.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/std/literal.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql create mode 100644 test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/insert/basic.edgeql create mode 100644 test/support/codegen/edgeql/types/insert/basic.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/basic.edgeql create mode 100644 test/support/codegen/edgeql/types/select/basic.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/links/convertors.edgeql create mode 100644 test/support/codegen/edgeql/types/select/links/convertors.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/links/multi.edgeql create mode 100644 test/support/codegen/edgeql/types/select/links/multi.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/links/nested.edgeql create mode 100644 test/support/codegen/edgeql/types/select/links/nested.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/links/optional.edgeql create mode 100644 test/support/codegen/edgeql/types/select/links/optional.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/links/required.edgeql create mode 100644 test/support/codegen/edgeql/types/select/links/required.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/multi.edgeql create mode 100644 test/support/codegen/edgeql/types/select/multi.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/required_single.edgeql create mode 100644 test/support/codegen/edgeql/types/select/required_single.edgeql.ex.assert create mode 100644 test/support/codegen/edgeql/types/select/single.edgeql create mode 100644 test/support/codegen/edgeql/types/select/single.edgeql.ex.assert rename {priv/edgedb => test/support}/schema/migrations/00001.edgeql (100%) rename {priv/edgedb => test/support}/schema/migrations/00002.edgeql (100%) rename {priv/edgedb => test/support}/schema/migrations/00003.edgeql (100%) rename {priv/edgedb => test/support}/schema/migrations/00004.edgeql (100%) create mode 100644 test/support/schema/migrations/00005.edgeql rename {priv/edgedb => test/support}/schema/v1.esdl (100%) rename {priv/edgedb => test/support}/schema/v2.esdl (100%) rename {priv/edgedb => test/support}/schema/v3.esdl (100%) rename {priv/edgedb => test/support}/schema/v4.esdl (100%) create mode 100644 test/support/schema/v4_codegen.esdl create mode 100755 test/support/scripts/drop-roles.sh rename {priv => test/support}/scripts/edgedb_docs.exs (98%) rename {priv => test/support}/scripts/edgeql/drop-roles.edgeql (100%) rename {priv => test/support}/scripts/edgeql/setup-roles.edgeql (100%) create mode 100755 test/support/scripts/setup-roles.sh diff --git a/.credo.exs b/.credo.exs index 16c6df25..faea0351 100644 --- a/.credo.exs +++ b/.credo.exs @@ -31,7 +31,13 @@ "apps/*/test/", "apps/*/web/" ], - excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] + excluded: [ + ~r"/_build/", + ~r"/deps/", + ~r"/node_modules/", + ~r"/test/codegen/queries/", + ~r"/test/support/scripts/" + ] }, # # Load and configure plugins here: @@ -131,7 +137,7 @@ {Credo.Check.Refactor.MatchInCondition, []}, {Credo.Check.Refactor.NegatedConditionsInUnless, []}, {Credo.Check.Refactor.NegatedConditionsWithElse, []}, - {Credo.Check.Refactor.Nesting, []}, + {Credo.Check.Refactor.Nesting, [max_nesting: 3]}, {Credo.Check.Refactor.UnlessWithElse, []}, {Credo.Check.Refactor.WithClauses, []}, diff --git a/.formatter.exs b/.formatter.exs index 5a0d2db8..d91b9092 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,4 +1,5 @@ # Used by "mix format" [ + line_length: 120, inputs: ["{mix,.formatter,.credo}.exs", "{config,lib,test}/**/*.{ex,exs}"] ] diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7fc2062d..70b975cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,15 +63,16 @@ jobs: run: | EDGEDB_VERSION=${EDGEDB_VERSION%%.*} - rm -r "priv/edgedb/schema/migrations/" + rm -r "test/support/schema/migrations/" - for module_file in `ls priv/edgedb/schema/` + for module_file in `ls test/support/schema/` do module_version=${module_file%.esdl} module_version=${module_version#v} + module_version=${module_version%_*} if test ${EDGEDB_VERSION} -lt ${module_version} then - module_path="priv/edgedb/schema/${module_file}" + module_path="test/support/schema/${module_file}" echo "removing ${module_path}" rm ${module_path} fi diff --git a/.gitignore b/.gitignore index 66715e07..a669cf68 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,4 @@ edgedb-*.tar # dialyzer priv/plts/ -examples/ +test/codegen/queries/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 0540cba4..5bf79c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,12 +17,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `EdgeDB.Object.id/1` to fetch ID from an `EdgeDB.Object` if it was returned from the query. - `EdgeDB.ConfigMemory.new/1` to create a new instance of `t:EdgeDB.ConfigMemory.t/0`. - support for `Elixir v1.16`. +- support for generating Elixir modules from EdgeQL queries via `mix edgedb.generate`. +- abitility to pass atoms as valid arguments for enums. ### Changed - `t:EdgeDB.Object.t/0` to be `opaque`. +- `jason` to be required library, but still configurable. +- `EdgeDB.NamedTuple.to_map/2` to include indexes as keys into result map. ### Fixed + - client state handling in `EdgeDB.with_config/2`/`EdgeDB.without_config/2`, `EdgeDB.with_globals/2`/`EdgeDB.without_globals/2` and `EdgeDB.with_module_aliases/2`/`EdgeDB.without_module_aliases/2`. diff --git a/config/config.exs b/config/config.exs index 68457def..af58acb3 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,3 +1,10 @@ import Config import_config("#{Mix.env()}.exs") + +config :edgedb, + generation: [ + queries_path: "test/support/codegen/edgeql/", + output_path: "test/codegen/queries/", + module_prefix: Tests.Codegen.Queries + ] diff --git a/edgedb.toml b/edgedb.toml index 5c9bf9e9..f501f2ca 100644 --- a/edgedb.toml +++ b/edgedb.toml @@ -2,4 +2,4 @@ server-version = "4.0" [project] -schema-dir = "./priv/edgedb/schema" +schema-dir = "./test/support/schema" diff --git a/lib/edgedb.ex b/lib/edgedb.ex index 8f07c6f3..1d412b81 100644 --- a/lib/edgedb.ex +++ b/lib/edgedb.ex @@ -175,6 +175,11 @@ defmodule EdgeDB do """ @type result() :: EdgeDB.Set.t() | term() + @typedoc """ + Parameter types acceptable by `EdgeDB.query*/4` functions. + """ + @type params() :: map() | list() | Keyword.t() + @doc """ Creates a pool of EdgeDB connections linked to the current process. @@ -307,7 +312,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query(client(), String.t(), list() | Keyword.t(), list(query_option())) :: + @spec query(client(), String.t(), params(), list(query_option())) :: {:ok, result()} | {:error, Exception.t()} def query(client, statement, params \\ [], opts \\ []) do @@ -317,7 +322,8 @@ defmodule EdgeDB do output_format: Keyword.get(opts, :output_format, :binary), required: Keyword.get(opts, :required, false), is_script: Keyword.get(opts, :script, false), - params: params + params: params, + __file__: opts[:__file__] } parse_execute_query(client, q, q.params, opts) @@ -332,7 +338,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query!(client(), String.t(), list(), list(query_option())) :: result() + @spec query!(client(), String.t(), params(), list(query_option())) :: result() def query!(client, statement, params \\ [], opts \\ []) do client |> query(statement, params, opts) @@ -347,7 +353,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_single(client(), String.t(), list(), list(query_option())) :: + @spec query_single(client(), String.t(), params(), list(query_option())) :: {:ok, result()} | {:error, Exception.t()} def query_single(client, statement, params \\ [], opts \\ []) do @@ -363,7 +369,8 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_single!(client(), String.t(), list(), list(query_option())) :: result() + @spec query_single!(client(), String.t(), params(), list(query_option())) :: + result() def query_single!(client, statement, params \\ [], opts \\ []) do client |> query_single(statement, params, opts) @@ -378,7 +385,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_required_single(client(), String.t(), list(), list(query_option())) :: + @spec query_required_single(client(), String.t(), params(), list(query_option())) :: {:ok, result()} | {:error, Exception.t()} def query_required_single(client, statement, params \\ [], opts \\ []) do @@ -394,7 +401,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_required_single!(client(), String.t(), list(), list(query_option())) :: result() + @spec query_required_single!(client(), String.t(), params(), list(query_option())) :: result() def query_required_single!(client, statement, params \\ [], opts \\ []) do client |> query_required_single(statement, params, opts) @@ -409,7 +416,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_json(client(), String.t(), list(), list(query_option())) :: + @spec query_json(client(), String.t(), params(), list(query_option())) :: {:ok, result()} | {:error, Exception.t()} def query_json(client, statement, params \\ [], opts \\ []) do @@ -425,7 +432,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_json!(client(), String.t(), list(), list(query_option())) :: result() + @spec query_json!(client(), String.t(), params(), list(query_option())) :: result() def query_json!(client, statement, params \\ [], opts \\ []) do client |> query_json(statement, params, opts) @@ -440,7 +447,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_single_json(client(), String.t(), list(), list(query_option())) :: + @spec query_single_json(client(), String.t(), params(), list(query_option())) :: {:ok, result()} | {:error, Exception.t()} def query_single_json(client, statement, params \\ [], opts \\ []) do @@ -456,7 +463,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_single_json!(client(), String.t(), list(), list(query_option())) :: result() + @spec query_single_json!(client(), String.t(), params(), list(query_option())) :: result() def query_single_json!(client, statement, params \\ [], opts \\ []) do client |> query_single_json(statement, params, opts) @@ -471,7 +478,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_required_single_json(client(), String.t(), list(), list(query_option())) :: + @spec query_required_single_json(client(), String.t(), params(), list(query_option())) :: {:ok, result()} | {:error, Exception.t()} def query_required_single_json(client, statement, params \\ [], opts \\ []) do @@ -487,7 +494,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec query_required_single_json!(client(), String.t(), list(), list(query_option())) :: + @spec query_required_single_json!(client(), String.t(), params(), list(query_option())) :: result() def query_required_single_json!(client, statement, params \\ [], opts \\ []) do client @@ -500,7 +507,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec execute(client(), String.t(), list(), list(query_option())) :: + @spec execute(client(), String.t(), params(), list(query_option())) :: :ok | {:error, Exception.t()} def execute(client, statement, params \\ [], opts \\ []) do opts = Keyword.merge(opts, output_format: :none, script: true, raw: true) @@ -521,7 +528,7 @@ defmodule EdgeDB do See `t:EdgeDB.query_option/0` for supported options. """ - @spec execute!(client(), String.t(), list(), list(query_option())) :: :ok + @spec execute!(client(), String.t(), params(), list(query_option())) :: :ok def execute!(client, statement, params \\ [], opts \\ []) do opts = Keyword.merge(opts, output_format: :none, script: true, raw: true) query!(client, statement, params, opts) diff --git a/lib/edgedb/connection.ex b/lib/edgedb/connection.ex index dc35afb6..d5c87c5a 100644 --- a/lib/edgedb/connection.ex +++ b/lib/edgedb/connection.ex @@ -479,9 +479,7 @@ defmodule EdgeDB.Connection do @impl DBConnection def handle_execute(%InternalRequest{request: request}, _params, _opts, state) do exc = - EdgeDB.InternalClientError.new( - "unknown internal request to connection: #{inspect(request)}" - ) + EdgeDB.InternalClientError.new("unknown internal request to connection: #{inspect(request)}") {:error, exc, state} end @@ -570,8 +568,7 @@ defmodule EdgeDB.Connection do false end) - {Keyword.put(socket_opts, :cacerts, [der_cert_data]), - :public_key.pkix_is_self_signed(der_cert_data)} + {Keyword.put(socket_opts, :cacerts, [der_cert_data]), :public_key.pkix_is_self_signed(der_cert_data)} end socket_opts = @@ -698,9 +695,7 @@ defmodule EdgeDB.Connection do defp handle_authentication_flow(%AuthenticationSASL{}, nil, %State{} = state) do exc = - EdgeDB.AuthenticationError.new( - "password should be provided for #{inspect(state.user)} authentication" - ) + EdgeDB.AuthenticationError.new("password should be provided for #{inspect(state.user)} authentication") {:disconnect, exc, state} end @@ -709,9 +704,7 @@ defmodule EdgeDB.Connection do case Enum.find(methods, &(&1 in @supported_authentication_methods)) do nil -> exc = - EdgeDB.AuthenticationError.new( - "EdgeDB requested unsupported authentication methods: #{inspect(methods)}" - ) + EdgeDB.AuthenticationError.new("EdgeDB requested unsupported authentication methods: #{inspect(methods)}") {:disconnect, exc, state} @@ -738,9 +731,7 @@ defmodule EdgeDB.Connection do else {:error, reason} -> exc = - EdgeDB.AuthenticationError.new( - "unable to continue SASL authentication: #{inspect(reason)}" - ) + EdgeDB.AuthenticationError.new("unable to continue SASL authentication: #{inspect(reason)}") {:disconnect, exc, state} @@ -760,9 +751,7 @@ defmodule EdgeDB.Connection do else {:error, reason} -> exc = - EdgeDB.AuthenticationError.new( - "unable to complete SASL authentication: #{inspect(reason)}" - ) + EdgeDB.AuthenticationError.new("unable to complete SASL authentication: #{inspect(reason)}") {:disconnect, exc, state} @@ -926,7 +915,13 @@ defmodule EdgeDB.Connection do ) with {:ok, state} <- wait_for_server_ready(state) do - {:ok, %EdgeDB.Query{query | codec_storage: state.codec_storage}, state} + query = %EdgeDB.Query{ + query + | codec_storage: state.codec_storage, + result_cardinality: message.result_cardinality + } + + {:ok, query, state} end end @@ -975,17 +970,19 @@ defmodule EdgeDB.Connection do %Server.V0.PrepareComplete{ input_typedesc_id: in_id, output_typedesc_id: out_id, - headers: %{capabilities: capabilities} + headers: %{capabilities: capabilities}, + cardinality: result_cardinality }, state ) do with {:ok, state} <- wait_for_server_ready(state) do - maybe_legacy_describe_codecs( - %EdgeDB.Query{query | capabilities: capabilities}, - in_id, - out_id, - state - ) + query = %EdgeDB.Query{ + query + | capabilities: capabilities, + result_cardinality: result_cardinality + } + + maybe_legacy_describe_codecs(query, in_id, out_id, state) end end @@ -1054,7 +1051,13 @@ defmodule EdgeDB.Connection do ) with {:ok, state} <- wait_for_server_ready(state) do - {:ok, %EdgeDB.Query{query | codec_storage: state.codec_storage}, state} + query = %EdgeDB.Query{ + query + | codec_storage: state.codec_storage, + result_cardinality: message.result_cardinality + } + + {:ok, query, state} end end @@ -1150,7 +1153,11 @@ defmodule EdgeDB.Connection do query = save_query_with_codecs_in_cache( state.queries_cache, - %EdgeDB.Query{query | capabilities: capabilities}, + %EdgeDB.Query{ + query + | capabilities: capabilities, + result_cardinality: message.result_cardinality + }, message.input_typedesc_id, message.output_typedesc_id ) @@ -1307,7 +1314,11 @@ defmodule EdgeDB.Connection do query = save_query_with_codecs_in_cache( state.queries_cache, - query, + %EdgeDB.Query{ + query + | capabilities: message.capabilities, + result_cardinality: message.result_cardinality + }, message.input_typedesc_id, message.output_typedesc_id ) @@ -1504,9 +1515,7 @@ defmodule EdgeDB.Connection do defp handle_ping_message(message, state) do exc = - EdgeDB.InternalClientError.new( - "unexpected EdgeDB message received during ping: #{inspect(message)}" - ) + EdgeDB.InternalClientError.new("unexpected EdgeDB message received during ping: #{inspect(message)}") {:disconect, exc, state} end @@ -1692,9 +1701,7 @@ defmodule EdgeDB.Connection do {:error, reason} -> exc = - EdgeDB.ClientConnectionError.new( - "unexpected error while receiving data from socket: #{inspect(reason)}" - ) + EdgeDB.ClientConnectionError.new("unexpected error while receiving data from socket: #{inspect(reason)}") {:disconnect, exc, state} end @@ -1715,9 +1722,7 @@ defmodule EdgeDB.Connection do {:error, reason} -> exc = - EdgeDB.ClientConnectionError.new( - "unexpected error while receiving data from socket: #{inspect(reason)}" - ) + EdgeDB.ClientConnectionError.new("unexpected error while receiving data from socket: #{inspect(reason)}") {:disconnect, exc, state} end diff --git a/lib/edgedb/connection/config.ex b/lib/edgedb/connection/config.ex index 434f9494..53d82006 100644 --- a/lib/edgedb/connection/config.ex +++ b/lib/edgedb/connection/config.ex @@ -396,9 +396,7 @@ defmodule EdgeDB.Connection.Config do parent = @path_module.dirname(dir) if parent == dir do - raise EdgeDB.ClientConnectionError.new( - ~s(no "edgedb.toml" found and no connection options specified) - ) + raise EdgeDB.ClientConnectionError.new(~s(no "edgedb.toml" found and no connection options specified)) end parent_dev = @file_module.stat!(parent).major_device diff --git a/lib/edgedb/connection/config/dsn.ex b/lib/edgedb/connection/config/dsn.ex index 63811e74..ea339986 100644 --- a/lib/edgedb/connection/config/dsn.ex +++ b/lib/edgedb/connection/config/dsn.ex @@ -105,8 +105,7 @@ defmodule EdgeDB.Connection.Config.DSN do defp parse(%URI{} = dsn, _opts) do raise RuntimeError, - message: - ~s(invalid DSN or instance name: scheme is expected to be "edgedb", got #{inspect(dsn.scheme)}) + message: ~s(invalid DSN or instance name: scheme is expected to be "edgedb", got #{inspect(dsn.scheme)}) end # URI module doesn't handle this, so should do that manually diff --git a/lib/edgedb/connection/config/validation.ex b/lib/edgedb/connection/config/validation.ex index c319382e..6fdb2505 100644 --- a/lib/edgedb/connection/config/validation.ex +++ b/lib/edgedb/connection/config/validation.ex @@ -167,8 +167,7 @@ defmodule EdgeDB.Connection.Config.Validation do def validate_security(option) do raise RuntimeError, - message: - "invalid security: #{option}, security can only be one of `insecure_dev_mode`, `strict` or `default`" + message: "invalid security: #{option}, security can only be one of `insecure_dev_mode`, `strict` or `default`" end @spec validate_tls_verify_hostname_with_tls_security(atom(), atom()) :: :ok | no_return() @@ -177,8 +176,7 @@ defmodule EdgeDB.Connection.Config.Validation do if (tls_security == :strict and tls_verify_hostname == false) or (tls_security in ~w(no_host_verification insecure)a and tls_verify_hostname == true) do raise RuntimeError, - message: - "tls_verify_hostname=#{tls_verify_hostname} and tls_security=#{tls_security} are incompatible" + message: "tls_verify_hostname=#{tls_verify_hostname} and tls_security=#{tls_security} are incompatible" else :ok end @@ -222,8 +220,7 @@ defmodule EdgeDB.Connection.Config.Validation do def validate_server_settings(_option) do raise RuntimeError, - message: - "invalid server_settings: server_settings is expected to be a map of strings/atoms to strings" + message: "invalid server_settings: server_settings is expected to be a map of strings/atoms to strings" end @spec validate_dsn_authority(term()) :: {String.t() | nil, :inet.port_number() | nil} | nil diff --git a/lib/edgedb/edgeql/generator.ex b/lib/edgedb/edgeql/generator.ex new file mode 100644 index 00000000..c4073ed7 --- /dev/null +++ b/lib/edgedb/edgeql/generator.ex @@ -0,0 +1,437 @@ +defmodule EdgeDB.EdgeQL.Generator do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator + + alias EdgeDB.Protocol.{ + Codecs, + CodecStorage + } + + @builtin_scalars_to_typespecs %{ + Codecs.UUID => {"std::uuid", "binary()"}, + Codecs.Str => {"std::str", "String.t()"}, + Codecs.Bytes => {"std::bytes", "bitstring()"}, + Codecs.Int16 => {"std::int16", "integer()"}, + Codecs.Int32 => {"std::int32", "integer()"}, + Codecs.Int64 => {"std::int64", "integer()"}, + Codecs.Float32 => {"std::float32", "float()"}, + Codecs.Float64 => {"std::float64", "float()"}, + Codecs.Decimal => {"std::decimal", "Decimal.t()"}, + Codecs.Bool => {"std::bool", "boolean()"}, + Codecs.DateTime => {"std::datetime", "DateTime.t()"}, + Codecs.Duration => {"std::duration", "integer()"}, + Codecs.JSON => {"std::json", "any()"}, + Codecs.LocalDateTime => {"cal::local_datetime", "NaiveDateTime.t()"}, + Codecs.LocalDate => {"cal::local_date", "Date.t()"}, + Codecs.LocalTime => {"cal::local_time", "Time.t()"}, + Codecs.BigInt => {"std::bigint", "Decimal.t()"}, + Codecs.RelativeDuration => {"cal::relative_duration", "EdgeDB.RelativeDuration.t()"}, + Codecs.DateDuration => {"cal::date_duration", "EdgeDB.DateDuration.t()"}, + Codecs.ConfigMemory => {"cfg::memory", "EdgeDB.ConfigMemory.t()"}, + Codecs.Vector => {"ext::pgvector::vector", "[float()]"} + } + @scalar_codecs Map.keys(@builtin_scalars_to_typespecs) + + @field_is_implicit Bitwise.bsl(1, 0) + @field_is_link_property Bitwise.bsl(1, 1) + @field_is_link Bitwise.bsl(1, 2) + + @types_tab :edgedb_edgeql_gen_types + + @default_output "./lib/" + + @spec generate(Keyword.t()) :: {:ok, %{Path.t() => Path.t()}} | {:error, term()} + def generate(opts) do + silent? = Keyword.get(opts, :silent, false) + + {:ok, client} = + opts + |> Keyword.merge( + max_concurrency: 1, + queue_target: :timer.seconds(30), + queue_interval: :timer.seconds(10) + ) + |> EdgeDB.start_link() + + generation_config = Application.get_env(:edgedb, :generation) + + if Keyword.keyword?(generation_config) do + do_modules_generation(client, generation_config, silent?) + else + Enum.reduce_while(generation_config, {:ok, %{}}, fn config, {:ok, files} -> + case do_modules_generation(client, config, silent?) do + {:ok, new_files} -> + {:cont, {:ok, Map.merge(files, new_files)}} + + error -> + {:halt, error} + end + end) + end + end + + defp do_modules_generation(client, config, silent?) do + queries_path = Keyword.fetch!(config, :queries_path) + + query_files = + [queries_path, "**", "*.edgeql"] + |> Path.join() + |> Path.wildcard() + + DBConnection.run( + client, + fn conn -> + Enum.reduce_while(query_files, {:ok, %{}}, fn query_file, {:ok, files} -> + case generate_module_for_query_file(conn, config, query_file, silent?) do + {:ok, elixir_file} -> + files = Map.put(files, query_file, elixir_file) + {:cont, {:ok, files}} + + {:error, error} -> + {:halt, {:error, {query_file, error}}} + end + end) + end, + timeout: :infinity + ) + end + + defp generate_module_for_query_file(conn, config, query_file, silent?) do + queries_path = Keyword.fetch!(config, :queries_path) + output_path = Keyword.get(config, :output_path, @default_output) + module_prefix = config[:module_prefix] + + statement = File.read!(query_file) + + query_name = + query_file + |> Path.rootname() + |> Path.basename() + |> String.split(".") + + query_parts = + query_file + |> Path.dirname() + |> Path.relative_to(queries_path) + |> Path.split() + |> Enum.reject(&(&1 == ".")) + + file_name = + [output_path, query_parts, "#{Enum.join(query_name, ".")}.edgeql.ex"] + |> List.flatten() + |> Path.join() + + if not silent? do + IO.puts("Generating #{file_name} from #{query_file}") + end + + module_parts = + if module_prefix do + List.flatten([Module.split(module_prefix), query_parts, query_name]) + else + List.flatten([query_parts, query_name]) + end + + query = %EdgeDB.Query{ + statement: statement, + required: true, + inline_type_names: true, + __file__: query_file + } + + module_name = Enum.map_join(module_parts, ".", &Macro.camelize/1) + + with {:ok, query} <- DBConnection.prepare(conn, query, edgeql_state: %EdgeDB.Client.State{}), + {:ok, elixir_file} <- generate_elixir_module(query, query_file, file_name, module_name) do + {:ok, elixir_file} + else + {:error, error} -> + {:error, error} + end + end + + defp generate_elixir_module(%EdgeDB.Query{} = query, query_file, output_file, module_name) do + reset_types() + + input_codec = CodecStorage.get(query.codec_storage, query.input_codec) + output_codec = CodecStorage.get(query.codec_storage, query.output_codec) + + args = input_codec_to_args(input_codec, query.codec_storage, module_name) + shape = output_codec_to_shape(query, output_codec, query.codec_storage, module_name) + + generated_module = + Generator.Render.render( + %Generator.Query{ + file: query_file, + module: module_name, + query: query.statement, + types: types(), + args: args, + shape: shape, + cardinality: query.result_cardinality + }, + :module + ) + + output_file + |> Path.dirname() + |> File.mkdir_p!() + + generated_module + |> Code.format_string!() + |> then(&File.write!(output_file, [&1, "\n"])) + + {:ok, output_file} + end + + defp input_codec_to_args(%Codecs.Null{}, _codec_storage, _module_name) do + %Generator.Args{is_empty: true} + end + + defp input_codec_to_args(%Codecs.Object{} = codec, codec_storage, module_name) do + positional? = + Enum.reduce_while(codec.shape_elements, false, fn %{name: name}, positional? -> + case Integer.parse(name) do + {_arg_index, ""} -> + {:halt, true} + + _other -> + {:cont, positional?} + end + end) + + args = + codec.shape_elements + |> Enum.zip(codec.codecs) + |> Enum.reduce([], fn {element, codec}, args -> + codec = CodecStorage.get(codec_storage, codec) + + [ + %Generator.Args.Arg{ + name: element.name, + is_optional: element.cardinality == :at_most_one, + type: handle_codec(codec, codec_storage, module_name) + } + | args + ] + end) + |> Enum.reverse() + + %Generator.Args{ + args: args, + is_empty: Enum.empty?(args), + is_positional: positional?, + is_named: not positional? + } + end + + defp output_codec_to_shape(%EdgeDB.Query{} = query, codec, codec_storage, module_name) do + %Generator.Shape{ + is_multi: query.result_cardinality in [:many, :at_least_one], + is_optional: query.result_cardinality == :at_most_one, + type: handle_codec(codec, codec_storage, module_name) + } + end + + defp handle_codec(%Codecs.Object{} = codec, codec_storage, module_name) do + fields = + codec.shape_elements + |> Enum.zip(codec.codecs) + |> Enum.reject(fn {%{flags: flags}, _codec} -> + Bitwise.band(flags, @field_is_implicit) != 0 + end) + |> Enum.with_index() + |> Enum.reduce([], fn {{%{flags: flags} = element, codec}, index}, fields -> + codec = CodecStorage.get(codec_storage, codec) + optional? = element.cardinality == :at_most_one + multi? = element.cardinality in [:many, :at_least_one] + + field = + if Bitwise.band(flags, @field_is_link) != 0 do + %Generator.Object.Link{ + name: element.name, + is_multi: multi?, + is_optional: optional?, + index: index, + type: handle_codec(codec, codec_storage, module_name) + } + else + %Generator.Object.Property{ + name: element.name, + is_multi: multi?, + is_optional: optional?, + is_link_property: Bitwise.band(flags, @field_is_link_property) != 0, + index: index, + type: handle_codec(codec, codec_storage, module_name) + } + end + + [field | fields] + end) + |> Enum.reverse() + + links = Enum.filter(fields, &match?(%Generator.Object.Link{}, &1)) + properties = Enum.filter(fields, &match?(%Generator.Object.Property{}, &1)) + + %Generator.Object{ + properties: properties, + links: links + } + end + + defp handle_codec(%Codecs.Set{} = codec, codec_storage, module_name) do + codec = CodecStorage.get(codec_storage, codec.codec) + + %Generator.Set{ + type: handle_codec(codec, codec_storage, module_name) + } + end + + defp handle_codec(%Codecs.UUID{}, _codec_storage, module_name) do + typename = "uuid()" + uuid_typespec = @builtin_scalars_to_typespecs[Codecs.UUID] + register_typespec(typename, uuid_typespec) + %Generator.Scalar{typespec: typename, module: module_name} + end + + defp handle_codec(%Codecs.JSON{}, _codec_storage, module_name) do + typename = "json()" + json_typespec = @builtin_scalars_to_typespecs[Codecs.JSON] + register_typespec(typename, json_typespec) + %Generator.Scalar{typespec: typename, module: module_name} + end + + defp handle_codec(%Codecs.Duration{}, _codec_storage, module_name) do + timex? = Application.get_env(:edgedb, :timex_duration, true) + + typename = "duration()" + + case Code.ensure_loaded?(Timex) do + true when timex? -> + {typedoc, typespec} = @builtin_scalars_to_typespecs[Codecs.Duration] + register_typespec(typename, {typedoc, ["Timex.Duration.t()", typespec]}) + + _other -> + duration_typespec = @builtin_scalars_to_typespecs[Codecs.Duration] + register_typespec(typename, duration_typespec) + end + + %Generator.Scalar{typespec: typename, module: module_name} + end + + defp handle_codec(%Codecs.Vector{}, _codec_storage, module_name) do + typename = "vector()" + vector_typespec = @builtin_scalars_to_typespecs[Codecs.Vector] + register_typespec(typename, vector_typespec) + %Generator.Scalar{typespec: typename, module: module_name} + end + + defp handle_codec(%codec_name{}, _codec_storage, _module_name) when codec_name in @scalar_codecs do + %Generator.Scalar{typespec: elem(@builtin_scalars_to_typespecs[codec_name], 1)} + end + + defp handle_codec(%Codecs.Scalar{codec: subcodec, name: nil}, codec_storage, _module_name) do + %subcodec_name{} = CodecStorage.get(codec_storage, subcodec) + {_typedoc, subcodec_typespec} = @builtin_scalars_to_typespecs[subcodec_name] + %{type: :builtin, typespec: subcodec_typespec} + %Generator.Scalar{typespec: subcodec_typespec} + end + + defp handle_codec(%Codecs.Scalar{codec: subcodec, name: type_name}, codec_storage, module_name) do + %subcodec_name{} = CodecStorage.get(codec_storage, subcodec) + + full_type_name = full_name_to_typespec(type_name) + {typedoc, subcodec_typespec} = @builtin_scalars_to_typespecs[subcodec_name] + typedoc = "scalar type #{type_name} extending #{typedoc}" + + register_typespec(full_type_name, {typedoc, subcodec_typespec}) + + %Generator.Scalar{typespec: full_type_name, module: module_name} + end + + defp handle_codec(%Codecs.Enum{name: type_name, members: members}, _codec_storage, module_name) do + full_type_name = full_name_to_typespec(type_name) + typedoc = "scalar type #{type_name} extending enum<#{Enum.join(members, ", ")}>" + + register_typespec( + full_type_name, + {typedoc, Enum.map(members, &":#{inspect(&1)}")} + ) + + %Generator.Enum{typespec: full_type_name, module: module_name, members: members} + end + + defp handle_codec(%Codecs.Array{codec: subcodec}, codec_storage, module_name) do + subcodec = CodecStorage.get(codec_storage, subcodec) + type = handle_codec(subcodec, codec_storage, module_name) + %Generator.Array{type: type} + end + + defp handle_codec(%Codecs.Tuple{codecs: subcodecs}, codec_storage, module_name) do + elements = + Enum.map(subcodecs, fn subcodec -> + subcodec = CodecStorage.get(codec_storage, subcodec) + handle_codec(subcodec, codec_storage, module_name) + end) + + %Generator.Tuple{elements: elements} + end + + defp handle_codec(%Codecs.NamedTuple{codecs: subcodecs, elements: elements}, codec_storage, module_name) do + elements = + subcodecs + |> Enum.zip(elements) + |> Enum.map(fn {subcodec, element} -> + subcodec = CodecStorage.get(codec_storage, subcodec) + type = handle_codec(subcodec, codec_storage, module_name) + %Generator.NamedTuple.Element{name: element.name, type: type} + end) + + %Generator.NamedTuple{elements: elements} + end + + defp handle_codec(%Codecs.Range{codec: subcodec}, codec_storage, module_name) do + subcodec = CodecStorage.get(codec_storage, subcodec) + type = handle_codec(subcodec, codec_storage, module_name) + %Generator.Range{type: type} + end + + defp handle_codec(%Codecs.MultiRange{codec: subcodec}, codec_storage, module_name) do + subcodec = CodecStorage.get(codec_storage, subcodec) + type = handle_codec(subcodec, codec_storage, module_name) + + %Generator.Range{type: type, is_multirange: true} + end + + defp full_name_to_typespec(type_name) do + type_name = + type_name + |> String.split("::") + |> Enum.map_join("__", &Macro.underscore/1) + + "#{type_name}()" + end + + defp types do + @types_tab + |> :ets.tab2list() + |> Enum.sort() + |> Enum.reverse() + end + + defp reset_types do + :ets.new(@types_tab, [:named_table]) + rescue + ArgumentError -> + :ets.delete_all_objects(@types_tab) + end + + defp register_typespec(type_name, {typedoc, typespecs}) when is_list(typespecs) do + register_typespec(type_name, {typedoc, Enum.join(typespecs, "|")}) + end + + defp register_typespec(type_name, {typedoc, typespec}) do + :ets.insert(@types_tab, {type_name, {typedoc, typespec}}) + end +end diff --git a/lib/edgedb/edgeql/generator/args.ex b/lib/edgedb/edgeql/generator/args.ex new file mode 100644 index 00000000..2c167abd --- /dev/null +++ b/lib/edgedb/edgeql/generator/args.ex @@ -0,0 +1,104 @@ +defmodule EdgeDB.EdgeQL.Generator.Args do + @moduledoc false + + defmodule Arg do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Array, + Enum, + NamedTuple, + Range, + Scalar, + Tuple + } + + defstruct [ + :name, + :type, + :is_optional + ] + + @type t() :: %__MODULE__{ + name: String.t(), + is_optional: boolean(), + type: + Array.t() + | Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + } + end + + defstruct [ + :is_positional, + :is_named, + :is_empty, + :args + ] + + @type t() :: %__MODULE__{ + is_positional: boolean(), + is_named: boolean(), + is_empty: boolean(), + args: list(Arg.t()) + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Args do + alias EdgeDB.EdgeQL.Generator.{ + Args, + Render + } + + require EEx + + @keyword_typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_args_keyword.eex"]) + EEx.function_from_file(:defp, :render_keyword_typespec_tpl, @keyword_typespec_tpl, [:assigns]) + + @map_typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_args_map.eex"]) + EEx.function_from_file(:defp, :render_map_typespec_tpl, @map_typespec_tpl, [:assigns]) + + @spec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_args.eex"]) + EEx.function_from_file(:defp, :render_spec_tpl, @spec_tpl, [:assigns]) + + @args_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "modules", "_args.eex"]) + EEx.function_from_file(:defp, :render_args_tpl, @args_tpl, [:assigns]) + + def render(args, mode, opts \\ []) + + def render(%Args{is_named: true} = args, {:typespec, :keyword}, opts) do + Render.Utils.render_to_line(&render_keyword_typespec_tpl/1, args: args, opts: opts) + end + + def render(%Args{is_named: true} = args, {:typespec, :map}, opts) do + Render.Utils.render_to_line(&render_map_typespec_tpl/1, args: args, opts: opts) + end + + def render(%Args{is_positional: true} = args, :spec, opts) do + Render.Utils.render_to_line(&render_spec_tpl/1, args: args, opts: opts) + end + + def render(%Args{is_positional: true} = args, :args, opts) do + Render.Utils.render_to_line(&render_args_tpl/1, args: args, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Args.Arg do + alias EdgeDB.EdgeQL.Generator.{ + Args, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_arg.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(%Args.Arg{} = arg, :typespec, opts \\ []) do + Render.Utils.render_to_line(&render_typespec_tpl/1, arg: arg, opts: Keyword.merge(opts, root: true)) + end +end diff --git a/lib/edgedb/edgeql/generator/array.ex b/lib/edgedb/edgeql/generator/array.ex new file mode 100644 index 00000000..506396ad --- /dev/null +++ b/lib/edgedb/edgeql/generator/array.ex @@ -0,0 +1,68 @@ +defmodule EdgeDB.EdgeQL.Generator.Array do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Enum, + NamedTuple, + Range, + Scalar, + Tuple + } + + defstruct [ + :type + ] + + @type t() :: %__MODULE__{ + type: + Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Array do + alias EdgeDB.EdgeQL.Generator.{ + Array, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_array.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(%Array{} = array, :typespec, opts \\ []) do + Render.Utils.render_to_line(&render_typespec_tpl/1, array: array, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Array do + alias EdgeDB.EdgeQL.Generator.{ + Array, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_array.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Array{} = array) do + Handler.variable?(array.type) + end + + @impl Handler + def handle(%Array{} = array, opts \\ []) do + render_handler_tpl(array: array, opts: opts) + end + + @impl Handler + def handle?(%Array{} = array) do + Handler.handle?(array.type) + end +end diff --git a/lib/edgedb/edgeql/generator/enum.ex b/lib/edgedb/edgeql/generator/enum.ex new file mode 100644 index 00000000..3214f56e --- /dev/null +++ b/lib/edgedb/edgeql/generator/enum.ex @@ -0,0 +1,60 @@ +defmodule EdgeDB.EdgeQL.Generator.Enum do + @moduledoc false + + defstruct [ + :module, + :typespec, + :members + ] + + @type t() :: %__MODULE__{ + module: String.t(), + typespec: String.t(), + members: list(String.t()) + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Enum do + alias EdgeDB.EdgeQL.Generator.{ + Enum, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_enum.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(%Enum{} = enum, :typespec, opts \\ []) do + Render.Utils.render_to_line(&render_typespec_tpl/1, enum: enum, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Enum do + alias EdgeDB.EdgeQL.Generator.{ + Enum, + Render, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_enum.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Enum{}) do + true + end + + @impl Handler + def handle(%Enum{} = enum, opts \\ []) do + Render.Utils.render_with_trim(&render_handler_tpl/1, enum: enum, opts: opts) + end + + @impl Handler + def handle?(%Enum{}) do + true + end +end diff --git a/lib/edgedb/edgeql/generator/handler.ex b/lib/edgedb/edgeql/generator/handler.ex new file mode 100644 index 00000000..73a3ae12 --- /dev/null +++ b/lib/edgedb/edgeql/generator/handler.ex @@ -0,0 +1,27 @@ +defprotocol EdgeDB.EdgeQL.Generator.Handler do + @moduledoc false + + @spec variable?(t()) :: boolean() + def variable?(entity) + + @spec handle(t(), Keyword.t()) :: iodata() + def handle(entity, opts \\ []) + + @spec handle?(t()) :: boolean() + def handle?(entity) +end + +defmodule EdgeDB.EdgeQL.Generator.Handler.Utils do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.Handler + + @spec variable(Handler.t(), String.t()) :: String.t() + def variable(entity, var) do + if Handler.variable?(entity) do + var + else + "_#{var}" + end + end +end diff --git a/lib/edgedb/edgeql/generator/named_tuple.ex b/lib/edgedb/edgeql/generator/named_tuple.ex new file mode 100644 index 00000000..2e9ca28c --- /dev/null +++ b/lib/edgedb/edgeql/generator/named_tuple.ex @@ -0,0 +1,101 @@ +defmodule EdgeDB.EdgeQL.Generator.NamedTuple do + @moduledoc false + + defmodule Element do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Array, + Enum, + NamedTuple, + Object, + Range, + Scalar, + Set, + Tuple + } + + defstruct [ + :name, + :type + ] + + @type t() :: %__MODULE__{ + name: String.t(), + type: + Array.t() + | Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + | Set.t() + | Object.t() + } + end + + defstruct [ + :elements + ] + + @type t() :: %__MODULE__{ + elements: list(Element.t()) + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.NamedTuple do + alias EdgeDB.EdgeQL.Generator.{ + NamedTuple, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_named_tuple.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(%NamedTuple{} = named_tuple, :typespec, opts \\ []) do + Render.Utils.render_to_line(&render_typespec_tpl/1, named_tuple: named_tuple, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.NamedTuple.Element do + alias EdgeDB.EdgeQL.Generator.{ + NamedTuple, + Render + } + + @impl Render + def render(%NamedTuple.Element{} = element, :typespec, opts \\ []) do + EdgeDB.EdgeQL.Generator.Render.render(element.type, :typespec, opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.NamedTuple do + alias EdgeDB.EdgeQL.Generator.{ + NamedTuple, + Render, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_named_tuple.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%NamedTuple{}) do + true + end + + @impl Handler + def handle(%NamedTuple{} = named_tuple, opts \\ []) do + Render.Utils.render_with_trim(&render_handler_tpl/1, named_tuple: named_tuple, opts: opts) + end + + @impl Handler + def handle?(%NamedTuple{}) do + true + end +end diff --git a/lib/edgedb/edgeql/generator/object.ex b/lib/edgedb/edgeql/generator/object.ex new file mode 100644 index 00000000..58eee563 --- /dev/null +++ b/lib/edgedb/edgeql/generator/object.ex @@ -0,0 +1,258 @@ +defmodule EdgeDB.EdgeQL.Generator.Object do + @moduledoc false + + defmodule Property do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Array, + Enum, + NamedTuple, + Object, + Range, + Scalar, + Set, + Tuple + } + + defstruct [ + :name, + :is_multi, + :is_optional, + :is_link_property, + :index, + :type + ] + + @type t() :: %__MODULE__{ + name: String.t(), + is_multi: boolean(), + is_optional: boolean(), + is_link_property: boolean(), + index: non_neg_integer(), + type: + Array.t() + | Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + | Set.t() + } + end + + defmodule Link do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Array, + Enum, + NamedTuple, + Object, + Range, + Scalar, + Set, + Tuple + } + + defstruct [ + :name, + :is_multi, + :is_optional, + :index, + :type + ] + + @type t() :: %__MODULE__{ + name: String.t(), + is_multi: boolean(), + is_optional: boolean(), + index: non_neg_integer(), + type: + Array.t() + | Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + | Set.t() + | Object.t() + } + end + + defstruct [ + :properties, + :links + ] + + @type t() :: %__MODULE__{ + properties: list(Property.t()), + links: list(Link.t()) + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Object do + alias EdgeDB.EdgeQL.Generator.{ + Object, + Render + } + + require EEx + + @module_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "modules", "_object.eex"]) + EEx.function_from_file(:defp, :render_module_tpl, @module_tpl, [:assigns]) + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_object.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(object, mode, opts \\ []) + + @impl Render + def render(%Object{} = object, :module, opts) do + render_module_tpl(object: object, opts: opts) + end + + @impl Render + def render(%Object{} = object, :typespec, opts) do + Render.Utils.render_to_line(&render_typespec_tpl/1, object: object, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Object.Link do + alias EdgeDB.EdgeQL.Generator.{ + Object, + Render + } + + require EEx + + @module_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "modules", "_link.eex"]) + EEx.function_from_file(:defp, :render_module_tpl, @module_tpl, [:assigns]) + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_link.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(link, mode, opts \\ []) + + @impl Render + def render(%Object.Link{} = link, :module, opts) do + render_module_tpl(link: link, opts: Keyword.put(opts, :module, Macro.camelize(link.name))) + end + + @impl Render + def render(%Object.Link{} = link, :typespec, opts) do + Render.Utils.render_to_line(&render_typespec_tpl/1, + link: link, + opts: Keyword.put(opts, :module, Macro.camelize(link.name)) + ) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Object.Property do + alias EdgeDB.EdgeQL.Generator.{ + Object, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_property.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(%Object.Property{} = property, :typespec, opts \\ []) do + Render.Utils.render_to_line(&render_typespec_tpl/1, property: property, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Object do + alias EdgeDB.EdgeQL.Generator.{ + Object, + Render, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_object.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Object{properties: [], links: []}) do + false + end + + @impl Handler + def variable?(%Object{}) do + true + end + + @impl Handler + def handle(%Object{} = object, opts \\ []) do + Render.Utils.render_with_trim(&render_handler_tpl/1, object: object, opts: opts) + end + + @impl Handler + def handle?(%Object{}) do + true + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Object.Property do + alias EdgeDB.EdgeQL.Generator.{ + Render, + Handler, + Object + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_property.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Object.Property{} = property) do + Handler.variable?(property.type) + end + + @impl Handler + def handle(%Object.Property{} = property, opts \\ []) do + Render.Utils.render_with_trim(&render_handler_tpl/1, property: property, opts: opts) + end + + @impl Handler + def handle?(%Object.Property{} = property) do + Handler.handle?(property.type) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Object.Link do + alias EdgeDB.EdgeQL.Generator.{ + Object, + Render, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_link.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Object.Link{} = link) do + Handler.variable?(link.type) + end + + @impl Handler + def handle(%Object.Link{} = link, opts \\ []) do + module = Enum.map_join([opts[:module], link.name], ".", &Macro.camelize/1) + Render.Utils.render_with_trim(&render_handler_tpl/1, link: link, opts: Keyword.put(opts, :module, module)) + end + + @impl Handler + def handle?(%Object.Link{}) do + true + end +end diff --git a/lib/edgedb/edgeql/generator/query.ex b/lib/edgedb/edgeql/generator/query.ex new file mode 100644 index 00000000..35932c4d --- /dev/null +++ b/lib/edgedb/edgeql/generator/query.ex @@ -0,0 +1,101 @@ +defmodule EdgeDB.EdgeQL.Generator.Query do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Args, + Shape + } + + alias EdgeDB.Protocol.Enums + + defstruct [ + :file, + :module, + :query, + :types, + :args, + :shape, + :cardinality + ] + + @type t() :: %__MODULE__{ + file: Path.t(), + module: String.t(), + query: String.t(), + types: list({String.t(), {String.t(), String.t()}}), + args: Args.t(), + shape: Shape.t(), + cardinality: Enums.cardinality() + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Query do + alias EdgeDB.EdgeQL.Generator.{ + Query, + Render + } + + require EEx + + @module_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "modules", "query.ex.eex"]) + EEx.function_from_file(:defp, :render_module_tpl, @module_tpl, [:assigns]) + + @impl Render + def render(%Query{} = query, :module, opts) do + render_module_tpl(query: query, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Query do + alias EdgeDB.EdgeQL.Generator.{ + Query, + Handler + } + + require EEx + + @execute_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_execute.eex"]) + EEx.function_from_file(:defp, :render_execute_tpl, @execute_tpl, []) + + @single_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_single.eex"]) + EEx.function_from_file(:defp, :render_single_tpl, @single_tpl, [:assigns]) + + @required_single_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_required_single.eex"]) + EEx.function_from_file(:defp, :render_required_single_tpl, @required_single_tpl, [:assigns]) + + @multi_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_multi.eex"]) + EEx.function_from_file(:defp, :render_multi_tpl, @multi_tpl, [:assigns]) + + @impl Handler + def variable?(%Query{}) do + true + end + + @impl Handler + def handle(query, opts \\ []) + + @impl Handler + def handle(%Query{cardinality: :no_result}, _opts) do + render_execute_tpl() + end + + @impl Handler + def handle(%Query{cardinality: :at_most_one} = query, opts) do + render_single_tpl(query: query, opts: opts) + end + + @impl Handler + def handle(%Query{cardinality: :one} = query, opts) do + render_required_single_tpl(query: query, opts: opts) + end + + @impl Handler + def handle(%Query{} = query, opts) do + render_multi_tpl(query: query, opts: opts) + end + + @impl Handler + def handle?(%Query{}) do + true + end +end diff --git a/lib/edgedb/edgeql/generator/range.ex b/lib/edgedb/edgeql/generator/range.ex new file mode 100644 index 00000000..b096b48c --- /dev/null +++ b/lib/edgedb/edgeql/generator/range.ex @@ -0,0 +1,54 @@ +defmodule EdgeDB.EdgeQL.Generator.Range do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.Scalar + + defstruct [ + :type, + is_multirange: false + ] + + @type t() :: %__MODULE__{ + type: Scalar.t(), + is_multirange: boolean() + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Range do + alias EdgeDB.EdgeQL.Generator.{ + Range, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_range.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns], trim: true) + + @impl Render + def render(%Range{} = range, :typespec, opts \\ []) do + Render.Utils.render_to_line(&render_typespec_tpl/1, range: range, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Range do + alias EdgeDB.EdgeQL.Generator.{ + Range, + Handler + } + + @impl Handler + def variable?(%Range{}) do + false + end + + @impl Handler + def handle(%Range{}, _opts \\ []) do + "" + end + + @impl Handler + def handle?(%Range{}) do + false + end +end diff --git a/lib/edgedb/edgeql/generator/render.ex b/lib/edgedb/edgeql/generator/render.ex new file mode 100644 index 00000000..b6c53ac1 --- /dev/null +++ b/lib/edgedb/edgeql/generator/render.ex @@ -0,0 +1,25 @@ +defprotocol EdgeDB.EdgeQL.Generator.Render do + @moduledoc false + + @spec render(t(), term(), Keyword.t()) :: iodata() + def render(entity, mode, opts \\ []) +end + +defmodule EdgeDB.EdgeQL.Generator.Render.Utils do + @moduledoc false + + @spec render_with_trim((Keyword.t() -> iodata()), Keyword.t()) :: iodata() + def render_with_trim(renderer, opts) do + opts + |> renderer.() + |> String.trim() + end + + @spec render_to_line((Keyword.t() -> iodata()), Keyword.t()) :: iodata() + def render_to_line(renderer, opts) do + renderer + |> render_with_trim(opts) + |> String.split("\n") + |> Enum.join(" ") + end +end diff --git a/lib/edgedb/edgeql/generator/scalar.ex b/lib/edgedb/edgeql/generator/scalar.ex new file mode 100644 index 00000000..645d3831 --- /dev/null +++ b/lib/edgedb/edgeql/generator/scalar.ex @@ -0,0 +1,52 @@ +defmodule EdgeDB.EdgeQL.Generator.Scalar do + @moduledoc false + + defstruct [ + :module, + :typespec + ] + + @type t() :: %__MODULE__{ + module: String.t(), + typespec: String.t() + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Scalar do + alias EdgeDB.EdgeQL.Generator.{ + Scalar, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_scalar.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns], trim: true) + + @impl Render + def render(%Scalar{} = scalar, :typespec, opts \\ []) do + Render.Utils.render_to_line(&render_typespec_tpl/1, scalar: scalar, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Scalar do + alias EdgeDB.EdgeQL.Generator.{ + Scalar, + Handler + } + + @impl Handler + def variable?(%Scalar{}) do + false + end + + @impl Handler + def handle(%Scalar{}, _opts \\ []) do + "" + end + + @impl Handler + def handle?(%Scalar{}) do + false + end +end diff --git a/lib/edgedb/edgeql/generator/set.ex b/lib/edgedb/edgeql/generator/set.ex new file mode 100644 index 00000000..769b5d49 --- /dev/null +++ b/lib/edgedb/edgeql/generator/set.ex @@ -0,0 +1,81 @@ +defmodule EdgeDB.EdgeQL.Generator.Set do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Array, + Enum, + NamedTuple, + Object, + Range, + Scalar, + Tuple + } + + defstruct [ + :type + ] + + @type t() :: %__MODULE__{ + type: + Array.t() + | Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + | Object.t() + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Set do + alias EdgeDB.EdgeQL.Generator.{ + Object, + Set, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_set.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns], trim: true) + + @impl Render + def render(set, mode, opts \\ []) + + @impl Render + def render(%Set{type: %Object{} = object}, :module, opts) do + EdgeDB.EdgeQL.Generator.Render.render(object, :module, opts) + end + + @impl Render + def render(%Set{} = set, :typespec, opts) do + Render.Utils.render_to_line(&render_typespec_tpl/1, set: set, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Set do + alias EdgeDB.EdgeQL.Generator.{ + Set, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_set.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Set{} = set) do + Handler.variable?(set.type) + end + + @impl Handler + def handle(%Set{} = set, opts \\ []) do + render_handler_tpl(set: set, opts: opts) + end + + @impl Handler + def handle?(%Set{} = set) do + Handler.handle?(set.type) + end +end diff --git a/lib/edgedb/edgeql/generator/shape.ex b/lib/edgedb/edgeql/generator/shape.ex new file mode 100644 index 00000000..6968b0e1 --- /dev/null +++ b/lib/edgedb/edgeql/generator/shape.ex @@ -0,0 +1,124 @@ +defmodule EdgeDB.EdgeQL.Generator.Shape do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Array, + Enum, + Handler, + NamedTuple, + Object, + Range, + Scalar, + Set, + Tuple + } + + defstruct [ + :is_multi, + :is_optional, + :type + ] + + @type t() :: %__MODULE__{ + is_multi: boolean(), + is_optional: boolean(), + type: + Array.t() + | Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + | Set.t() + | Object.t() + } + + @spec complex?(%__MODULE__{}) :: boolean() + + def complex?(%__MODULE__{type: %Object{}}) do + true + end + + def complex?(%__MODULE__{type: %Set{type: %Object{}}}) do + true + end + + def complex?(%__MODULE__{}) do + false + end +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Shape do + alias EdgeDB.EdgeQL.Generator.{ + Shape, + Set, + Object, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_shape.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(shape, mode, opts \\ []) + + @impl Render + def render(%Shape{type: %Object{} = object}, :module, opts) do + Render.render(object, :module, Keyword.merge(opts, module: "Result", root: false)) + end + + @impl Render + def render(%Shape{type: %Set{type: %Object{} = object}}, :module, opts) do + Render.render(object, :module, Keyword.merge(opts, module: "Result", root: false)) + end + + @impl Render + def render(%Shape{type: %Object{}} = shape, :typespec, opts) do + Render.Utils.render_to_line(&render_typespec_tpl/1, + shape: shape, + opts: Keyword.merge(opts, module: "Result", root: false) + ) + end + + @impl Render + def render(%Shape{type: %Set{type: %Object{}}} = shape, :typespec, opts) do + Render.Utils.render_to_line(&render_typespec_tpl/1, + shape: shape, + opts: Keyword.merge(opts, module: "Result", root: false) + ) + end + + @impl Render + def render(%Shape{} = shape, :typespec, opts) do + Render.Utils.render_to_line(&render_typespec_tpl/1, shape: shape, opts: Keyword.merge(opts, root: true)) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Shape do + alias EdgeDB.EdgeQL.Generator.{ + Shape, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_shape.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Shape{} = shape) do + Handler.variable?(shape.type) + end + + @impl Handler + def handle(%Shape{} = shape, opts \\ []) do + render_handler_tpl(shape: shape, opts: Keyword.put(opts, :module, "Result")) + end + + @impl Handler + def handle?(%Shape{} = shape) do + Handler.handle?(shape.type) + end +end diff --git a/lib/edgedb/edgeql/generator/tuple.ex b/lib/edgedb/edgeql/generator/tuple.ex new file mode 100644 index 00000000..c97c016a --- /dev/null +++ b/lib/edgedb/edgeql/generator/tuple.ex @@ -0,0 +1,77 @@ +defmodule EdgeDB.EdgeQL.Generator.Tuple do + @moduledoc false + + alias EdgeDB.EdgeQL.Generator.{ + Array, + Enum, + NamedTuple, + Object, + Range, + Scalar, + Set, + Tuple + } + + defstruct [ + :elements + ] + + @type t() :: %__MODULE__{ + elements: + list( + Array.t() + | Enum.t() + | NamedTuple.t() + | Range.t() + | Scalar.t() + | Tuple.t() + | Set.t() + | Object.t() + ) + } +end + +defimpl EdgeDB.EdgeQL.Generator.Render, for: EdgeDB.EdgeQL.Generator.Tuple do + alias EdgeDB.EdgeQL.Generator.{ + Tuple, + Render + } + + require EEx + + @typespec_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "typespecs", "_tuple.eex"]) + EEx.function_from_file(:defp, :render_typespec_tpl, @typespec_tpl, [:assigns]) + + @impl Render + def render(%Tuple{} = tuple, :typespec, opts \\ []) do + Render.Utils.render_with_trim(&render_typespec_tpl/1, tuple: tuple, opts: opts) + end +end + +defimpl EdgeDB.EdgeQL.Generator.Handler, for: EdgeDB.EdgeQL.Generator.Tuple do + alias EdgeDB.EdgeQL.Generator.{ + Tuple, + Render, + Handler + } + + require EEx + + @handler_tpl Path.join([:code.priv_dir(:edgedb), "codegen", "templates", "handlers", "_tuple.eex"]) + EEx.function_from_file(:defp, :render_handler_tpl, @handler_tpl, [:assigns]) + + @impl Handler + def variable?(%Tuple{} = tuple) do + Enum.any?(tuple.elements, &Handler.variable?/1) + end + + @impl Handler + def handle(%Tuple{} = tuple, opts \\ []) do + Render.Utils.render_with_trim(&render_handler_tpl/1, tuple: tuple, opts: opts) + end + + @impl Handler + def handle?(%Tuple{} = tuple) do + Enum.any?(tuple.elements, &Handler.handle?/1) + end +end diff --git a/lib/edgedb/error.ex b/lib/edgedb/error.ex index 94e4b060..0ef5640b 100644 --- a/lib/edgedb/error.ex +++ b/lib/edgedb/error.ex @@ -237,7 +237,7 @@ defmodule EdgeDB.Error do [:reset, "#{exception.name}: "], [:bright, "#{exception.message}", "\n"], [:blue, "#{String.pad_leading("", padding)} ┌─ "], - [:reset, "query:#{config.line}:#{config.col}", "\n"], + [:reset, "#{config.file}:#{config.line}:#{config.col}", "\n"], [:blue, "#{String.pad_leading("", padding)} │", "\n"] | Enum.reverse(lines) ] @@ -249,7 +249,11 @@ defmodule EdgeDB.Error do "#{exception.name}: #{exception.message}" end - defp generate_render_config(%__MODULE__{} = exception, true, color_errors?) do + defp generate_render_config( + %__MODULE__{query: %EdgeDB.Query{}} = exception, + true, + color_errors? + ) do position_start = case Integer.parse(exception.attributes[:character_start] || "") do {position_start, ""} -> @@ -274,6 +278,7 @@ defmodule EdgeDB.Error do line: exception.attributes[:line_start] || "?", col: exception.attributes[:column_start] || "?", hint: exception.attributes[:hint] || "error", + file: exception.query.__file__ || "query", use_color: color_errors? } end diff --git a/lib/edgedb/protocol/codecs/bigint.ex b/lib/edgedb/protocol/codecs/bigint.ex index 7ab1e326..f561ce22 100644 --- a/lib/edgedb/protocol/codecs/bigint.ex +++ b/lib/edgedb/protocol/codecs/bigint.ex @@ -37,9 +37,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.BigInt do @impl Codec def encode(_codec, number, _codec_storage) when is_float(number) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::bigint: value is float: #{inspect(number)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::bigint: value is float: #{inspect(number)}") end @impl Codec @@ -64,9 +62,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.BigInt do e in EdgeDB.Error -> "value can not be encoded as std::decimal: " <> reason = e.message - reraise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::bigint: #{reason}" - ), + reraise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::bigint: #{reason}"), __STACKTRACE__ end diff --git a/lib/edgedb/protocol/codecs/bool.ex b/lib/edgedb/protocol/codecs/bool.ex index 3c15732c..8571a350 100644 --- a/lib/edgedb/protocol/codecs/bool.ex +++ b/lib/edgedb/protocol/codecs/bool.ex @@ -40,9 +40,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Bool do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::bool: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::bool: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/bytes.ex b/lib/edgedb/protocol/codecs/bytes.ex index 1baa7fc5..533d27ae 100644 --- a/lib/edgedb/protocol/codecs/bytes.ex +++ b/lib/edgedb/protocol/codecs/bytes.ex @@ -35,9 +35,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Bytes do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::bytes: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::bytes: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/config_memory.ex b/lib/edgedb/protocol/codecs/config_memory.ex index 0c320488..3e853339 100644 --- a/lib/edgedb/protocol/codecs/config_memory.ex +++ b/lib/edgedb/protocol/codecs/config_memory.ex @@ -41,9 +41,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.ConfigMemory do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cfg::memory: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as cfg::memory: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/date_duration.ex b/lib/edgedb/protocol/codecs/date_duration.ex index d810069d..5183a759 100644 --- a/lib/edgedb/protocol/codecs/date_duration.ex +++ b/lib/edgedb/protocol/codecs/date_duration.ex @@ -35,9 +35,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.DateDuration do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cal::date_duration: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as cal::date_duration: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/datetime.ex b/lib/edgedb/protocol/codecs/datetime.ex index bf4dba9c..89586236 100644 --- a/lib/edgedb/protocol/codecs/datetime.ex +++ b/lib/edgedb/protocol/codecs/datetime.ex @@ -46,9 +46,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.DateTime do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::datetime: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::datetime: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/decimal.ex b/lib/edgedb/protocol/codecs/decimal.ex index 511bcf99..e9cd6cdf 100644 --- a/lib/edgedb/protocol/codecs/decimal.ex +++ b/lib/edgedb/protocol/codecs/decimal.ex @@ -97,9 +97,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Decimal do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::decimal: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::decimal: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/duration.ex b/lib/edgedb/protocol/codecs/duration.ex index 391dcc6f..bdde05d3 100644 --- a/lib/edgedb/protocol/codecs/duration.ex +++ b/lib/edgedb/protocol/codecs/duration.ex @@ -45,9 +45,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Duration do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::duration: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::duration: #{inspect(value)}") end if @use_timex and Code.ensure_loaded?(Timex) do diff --git a/lib/edgedb/protocol/codecs/enum.ex b/lib/edgedb/protocol/codecs/enum.ex index e0a49305..e212fe29 100644 --- a/lib/edgedb/protocol/codecs/enum.ex +++ b/lib/edgedb/protocol/codecs/enum.ex @@ -3,7 +3,11 @@ defmodule EdgeDB.Protocol.Codecs.Enum do alias EdgeDB.Protocol.Codec - defstruct [:id, :name, :members] + defstruct [ + :id, + :name, + :members + ] @spec new(Codec.t(), String.t() | nil, list(String.t())) :: Codec.t() def new(id, name, members) do @@ -21,12 +25,15 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Enum do @impl Codec def encode(%{members: members}, value, codec_storage) do - if value in members do - Codec.encode(@str_codec, value, codec_storage) - else - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as enum: not enum member: #{inspect(value)}" - ) + cond do + is_binary(value) and value in members -> + Codec.encode(@str_codec, value, codec_storage) + + is_atom(value) and to_string(value) in members -> + Codec.encode(@str_codec, to_string(value), codec_storage) + + true -> + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as enum: not enum member: #{inspect(value)}") end end diff --git a/lib/edgedb/protocol/codecs/float32.ex b/lib/edgedb/protocol/codecs/float32.ex index 752dd775..4259e29e 100644 --- a/lib/edgedb/protocol/codecs/float32.ex +++ b/lib/edgedb/protocol/codecs/float32.ex @@ -51,9 +51,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Float32 do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::float32: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::float32: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/float64.ex b/lib/edgedb/protocol/codecs/float64.ex index 32bfb6d4..6e297a8c 100644 --- a/lib/edgedb/protocol/codecs/float64.ex +++ b/lib/edgedb/protocol/codecs/float64.ex @@ -51,9 +51,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Float64 do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::float64: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::float64: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/int16.ex b/lib/edgedb/protocol/codecs/int16.ex index 58b61413..b01167b3 100644 --- a/lib/edgedb/protocol/codecs/int16.ex +++ b/lib/edgedb/protocol/codecs/int16.ex @@ -36,9 +36,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Int16 do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int16: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int16: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/int32.ex b/lib/edgedb/protocol/codecs/int32.ex index c20e29e0..eec1443f 100644 --- a/lib/edgedb/protocol/codecs/int32.ex +++ b/lib/edgedb/protocol/codecs/int32.ex @@ -36,9 +36,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Int32 do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int32: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int32: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/int64.ex b/lib/edgedb/protocol/codecs/int64.ex index d664ba3a..4738c4cc 100644 --- a/lib/edgedb/protocol/codecs/int64.ex +++ b/lib/edgedb/protocol/codecs/int64.ex @@ -36,9 +36,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Int64 do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int64: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int64: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/local_date.ex b/lib/edgedb/protocol/codecs/local_date.ex index f005f19e..78fbd10b 100644 --- a/lib/edgedb/protocol/codecs/local_date.ex +++ b/lib/edgedb/protocol/codecs/local_date.ex @@ -42,9 +42,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.LocalDate do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cal::local_date: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as cal::local_date: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/local_datetime.ex b/lib/edgedb/protocol/codecs/local_datetime.ex index e8a012d8..4fd2d1b7 100644 --- a/lib/edgedb/protocol/codecs/local_datetime.ex +++ b/lib/edgedb/protocol/codecs/local_datetime.ex @@ -50,9 +50,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.LocalDateTime do @impl Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cal::local_datetime: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as cal::local_datetime: #{inspect(value)}") end @impl Codec diff --git a/lib/edgedb/protocol/codecs/local_time.ex b/lib/edgedb/protocol/codecs/local_time.ex index 0615df23..938110df 100644 --- a/lib/edgedb/protocol/codecs/local_time.ex +++ b/lib/edgedb/protocol/codecs/local_time.ex @@ -38,9 +38,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.LocalTime do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cal::local_date: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as cal::local_date: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/multi_range.ex b/lib/edgedb/protocol/codecs/multi_range.ex index da56eef4..99916658 100644 --- a/lib/edgedb/protocol/codecs/multi_range.ex +++ b/lib/edgedb/protocol/codecs/multi_range.ex @@ -38,9 +38,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.MultiRange do @impl Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as multirange: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as multirange: #{inspect(value)}") end @impl Codec diff --git a/lib/edgedb/protocol/codecs/named_tuple.ex b/lib/edgedb/protocol/codecs/named_tuple.ex index 185f68be..cd449183 100644 --- a/lib/edgedb/protocol/codecs/named_tuple.ex +++ b/lib/edgedb/protocol/codecs/named_tuple.ex @@ -70,9 +70,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.NamedTuple do @impl Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as named tuple: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as named tuple: #{inspect(value)}") end @impl Codec diff --git a/lib/edgedb/protocol/codecs/object.ex b/lib/edgedb/protocol/codecs/object.ex index 3349eb87..2b285a8a 100644 --- a/lib/edgedb/protocol/codecs/object.ex +++ b/lib/edgedb/protocol/codecs/object.ex @@ -53,17 +53,13 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Object do @impl Codec def encode(_codec, %EdgeDB.Object{}, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as object: objects encoding is not supported" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as object: objects encoding is not supported") end # maybe worth adding in future, but for now it's not allowed @impl Codec def encode(_codec, %{__struct__: _struct_mod}, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as object: structs encoding is not supported" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as object: structs encoding is not supported") end @impl Codec @@ -261,9 +257,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Object do end if is_nil(value) and (cardinality == :one or cardinality == :at_least_one) do - raise EdgeDB.InvalidArgumentError.new( - "argument #{inspect(name)} is required, but received nil" - ) + raise EdgeDB.InvalidArgumentError.new("argument #{inspect(name)} is required, but received nil") end {value, codec} diff --git a/lib/edgedb/protocol/codecs/relative_duration.ex b/lib/edgedb/protocol/codecs/relative_duration.ex index 255f11ee..ad62dfbd 100644 --- a/lib/edgedb/protocol/codecs/relative_duration.ex +++ b/lib/edgedb/protocol/codecs/relative_duration.ex @@ -35,9 +35,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.RelativeDuration do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cal::relative_duration: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as cal::relative_duration: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/set.ex b/lib/edgedb/protocol/codecs/set.ex index cad5ba59..dd498452 100644 --- a/lib/edgedb/protocol/codecs/set.ex +++ b/lib/edgedb/protocol/codecs/set.ex @@ -28,9 +28,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Set do @impl Codec def encode(_codec, %EdgeDB.Set{}, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as set: set encoding is not supported" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as set: set encoding is not supported") end @impl Codec diff --git a/lib/edgedb/protocol/codecs/str.ex b/lib/edgedb/protocol/codecs/str.ex index f2e8673c..8e80c3f0 100644 --- a/lib/edgedb/protocol/codecs/str.ex +++ b/lib/edgedb/protocol/codecs/str.ex @@ -35,9 +35,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Str do @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::str: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::str: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/uuid.ex b/lib/edgedb/protocol/codecs/uuid.ex index 0b1cc944..56f3ccf7 100644 --- a/lib/edgedb/protocol/codecs/uuid.ex +++ b/lib/edgedb/protocol/codecs/uuid.ex @@ -33,17 +33,13 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.UUID do <<16::uint32(), UUID.string_to_binary!(uuid)::uuid()>> rescue e in ArgumentError -> - reraise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::uuid: #{e.message}" - ), + reraise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::uuid: #{e.message}"), __STACKTRACE__ end @impl EdgeDB.Protocol.Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::uuid: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as std::uuid: #{inspect(value)}") end @impl EdgeDB.Protocol.Codec diff --git a/lib/edgedb/protocol/codecs/vector.ex b/lib/edgedb/protocol/codecs/vector.ex index 4d4f8e28..e3238ce4 100644 --- a/lib/edgedb/protocol/codecs/vector.ex +++ b/lib/edgedb/protocol/codecs/vector.ex @@ -65,9 +65,7 @@ defimpl EdgeDB.Protocol.Codec, for: EdgeDB.Protocol.Codecs.Vector do @impl Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as ext::pgvector::vector: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as ext::pgvector::vector: #{inspect(value)}") end @impl Codec diff --git a/lib/edgedb/query.ex b/lib/edgedb/query.ex index 9ae603eb..5f352475 100644 --- a/lib/edgedb/query.ex +++ b/lib/edgedb/query.ex @@ -15,6 +15,7 @@ defmodule EdgeDB.Query do inline_type_ids: false, inline_object_ids: true, cardinality: :many, + result_cardinality: :many, required: false, is_script: false, capabilities: [], @@ -22,7 +23,8 @@ defmodule EdgeDB.Query do output_codec: nil, codec_storage: nil, cached: false, - params: [] + params: [], + __file__: nil ] @type t() :: %__MODULE__{ @@ -33,6 +35,7 @@ defmodule EdgeDB.Query do inline_type_ids: boolean(), inline_object_ids: boolean(), cardinality: Enums.cardinality(), + result_cardinality: Enums.cardinality(), required: boolean(), is_script: boolean(), capabilities: Enums.capabilities(), @@ -40,7 +43,8 @@ defmodule EdgeDB.Query do output_codec: Codec.id() | nil, codec_storage: CodecStorage.t(), cached: boolean(), - params: list(any()) + params: map() | list() | Keyword.t(), + __file__: Path.t() | nil } end diff --git a/lib/edgedb/result.ex b/lib/edgedb/result.ex index 788f1f74..7ccdd008 100644 --- a/lib/edgedb/result.ex +++ b/lib/edgedb/result.ex @@ -21,6 +21,8 @@ defmodule EdgeDB.Result do {:ok, EdgeDB.Set.t() | term() | :done} | {:error, Exception.t()} + def extract(result) + def extract(%__MODULE__{set: data}) when is_list(data) do {:error, EdgeDB.InterfaceError.new("result hasn't been decoded yet")} end diff --git a/lib/edgedb/sandbox.ex b/lib/edgedb/sandbox.ex index 082e5462..eb314d00 100644 --- a/lib/edgedb/sandbox.ex +++ b/lib/edgedb/sandbox.ex @@ -240,8 +240,7 @@ defmodule EdgeDB.Sandbox do {:error, exc, %State{conn_state: :not_in_transaction, internal_state: internal_state}} {:disconnect, exc, internal_state} -> - {:disconnect, exc, - %State{conn_state: :not_in_transaction, internal_state: internal_state}} + {:disconnect, exc, %State{conn_state: :not_in_transaction, internal_state: internal_state}} end end @@ -263,12 +262,9 @@ defmodule EdgeDB.Sandbox do {:disconnect, exc, internal_state} -> exc = - EdgeDB.ClientError.new( - "unable to rollback transaction for sandbox connection: #{exc.message}" - ) + EdgeDB.ClientError.new("unable to rollback transaction for sandbox connection: #{exc.message}") - {:disconnect, exc, - %State{conn_state: :in_failed_transaction, internal_state: internal_state}} + {:disconnect, exc, %State{conn_state: :in_failed_transaction, internal_state: internal_state}} end end diff --git a/lib/edgedb/types/named_tuple.ex b/lib/edgedb/types/named_tuple.ex index 41b0e386..7745177e 100644 --- a/lib/edgedb/types/named_tuple.ex +++ b/lib/edgedb/types/named_tuple.ex @@ -56,12 +56,16 @@ defmodule EdgeDB.NamedTuple do iex(1)> {:ok, client} = EdgeDB.start_link() iex(2)> nt = EdgeDB.query_required_single!(client, "select (a := 1, b := 'a', c := [3])") iex(3)> EdgeDB.NamedTuple.to_map(nt) - %{"a" => 1, "b" => "a", "c" => [3]} + %{"a" => 1, 0 => 1, "b" => "a", 1 => "a", "c" => [3], 2 => [3]} ``` """ - @spec to_map(t()) :: %{String.t() => term()} - def to_map(%__MODULE__{items: items}) do - items + @spec to_map(t()) :: %{(String.t() | integer()) => term()} + def to_map(%__MODULE__{items: items, order: fields_order}) do + fields_order + |> Enum.into(%{}, fn {index, name} -> + {index, items[name]} + end) + |> Map.merge(items) end @doc """ diff --git a/lib/mix/edgedb/generate.ex b/lib/mix/edgedb/generate.ex new file mode 100644 index 00000000..eea4116c --- /dev/null +++ b/lib/mix/edgedb/generate.ex @@ -0,0 +1,114 @@ +# credo:disable-for-this-file +defmodule Mix.Tasks.Edgedb.Generate do + @validator_definition [ + silent: [ + type: :boolean, + doc: "Show processing messages." + ], + dsn: [ + type: :string, + doc: "DSN that defines the primary information that can be used to connect to the instance." + ], + credentials_file: [ + type: :string, + doc: "the path to the instance credentials file containing the instance parameters to connect to." + ], + instance: [ + type: :string, + doc: "the name of the instance to connect to." + ], + host: [ + type: :string, + doc: "the host name of the instance to connect to." + ], + port: [ + type: :non_neg_integer, + doc: "the port number of the instance to connect to." + ], + database: [ + type: :string, + doc: "the name of the database to connect to." + ], + user: [ + type: :string, + doc: "the user name to connect to." + ], + password: [ + type: :string, + doc: "the user password to connect." + ], + tls_ca_file: [ + type: :string, + doc: "the path to the TLS certificate to be used when connecting to the instance." + ], + tls_security: [ + type: {:in, ["insecure", "no_host_verification", "strict", "default"]}, + doc: "security mode for the TLS connection." + ] + ] + + @shortdoc "Generate Elixir modules from EdgeQL queries" + + @moduledoc """ + Generate Elixir modules from EdgeQL queries. + + To configure generation modify `:generation` key under + the `:edgedb` application configuration. + + Supported options (may be provided as a list of configs): + + * `:queries_path` - path to queries. Required. + * `:output_path` - path to store generated Elixir code. By default + `./lib` is used. + * `:module_prefix` - prefix to name generated modules. By default + no prefix is used. + + Supported arguments for task: + + #{NimbleOptions.docs(@validator_definition)} + """ + + use Mix.Task + + @impl Mix.Task + def run(args) do + Application.ensure_all_started(:edgedb) + + with {args, [], []} <- OptionParser.parse(args, strict: parser_definition()), + {:ok, args} <- NimbleOptions.validate(args, @validator_definition), + {:ok, _files} <- EdgeDB.EdgeQL.Generator.generate(args) do + Mix.shell().info("Modules for queries generated succesfully!") + else + {_args, _unparsed, errors} -> + Mix.shell().error("Unable to parse arguments: #{inspect(Enum.map(errors, fn {key, _value} -> key end))}") + + {_args, unparsed, []} -> + Mix.shell().error("Unable to parse some of provided arguments: #{inspect(unparsed)}") + + {:error, %NimbleOptions.ValidationError{key: key} = error} -> + Mix.shell().error("Error while validating #{inspect(key)} argument: #{Exception.message(error)}") + + {:error, {query_file, %EdgeDB.Error{} = error}} -> + Mix.shell().error("Error while generating module for query from #{query_file}!") + Mix.shell().error(Exception.message(error)) + end + end + + defp parser_definition do + Enum.map(@validator_definition, fn {arg, opts} -> + type = + case opts[:type] do + :non_neg_integer -> + :integer + + {:in, _variants} -> + :string + + type -> + type + end + + {arg, type} + end) + end +end diff --git a/mix.exs b/mix.exs index 55177a5b..bf19bdb6 100644 --- a/mix.exs +++ b/mix.exs @@ -33,7 +33,8 @@ defmodule EdgeDB.MixProject do extra_applications: [ :crypto, :logger, - :ssl + :ssl, + :eex ] ] end @@ -48,7 +49,8 @@ defmodule EdgeDB.MixProject do {:crc, "~> 0.10.4"}, {:castore, "~> 0.1.0 or ~> 1.0"}, {:ucwidth, "~> 0.2.0"}, - {:jason, "~> 1.2", optional: true}, + {:nimble_options, "~> 1.0"}, + {:jason, "~> 1.2"}, {:timex, "~> 3.7", optional: true}, # test {:excoveralls, "~> 0.14", only: [:test, :ci]}, @@ -63,7 +65,7 @@ defmodule EdgeDB.MixProject do end defp elixirc_paths(:test) do - ["lib", "test/support"] + ["lib", "test/support", "test/codegen"] end defp elixirc_paths(_env) do @@ -72,7 +74,7 @@ defmodule EdgeDB.MixProject do defp elixirc_options do [ - warnings_as_errors: true + warnings_as_errors: false ] end @@ -98,7 +100,8 @@ defmodule EdgeDB.MixProject do "edgedb.docs": :ci, coveralls: :test, "coveralls.detail": :test, - "coveralls.html": :test + "coveralls.html": :test, + "edgedb.generate": :dev ] end @@ -107,7 +110,8 @@ defmodule EdgeDB.MixProject do plt_add_apps: [ :ex_unit, :jason, - :timex + :timex, + :mix ], plt_file: {:no_warn, "priv/plts/dialyzer.plt"} ] @@ -133,6 +137,7 @@ defmodule EdgeDB.MixProject do extras: [ "pages/md/main.md", "pages/md/usage.md", + "pages/md/codegen.md", "pages/md/datatypes.md", "pages/md/custom-codecs.md", "CHANGELOG.md" @@ -163,14 +168,14 @@ defmodule EdgeDB.MixProject do defp aliases do [ "edgedb.roles.setup": [ - "cmd priv/scripts/setup-roles.sh" + "cmd test/support/scripts/setup-roles.sh" ], "edgedb.roles.reset": [ - "cmd priv/scripts/drop-roles.sh", - "cmd priv/scripts/setup-roles.sh" + "cmd test/support/scripts/drop-roles.sh", + "cmd test/support/scripts/setup-roles.sh" ], "edgedb.docs": [ - "run priv/scripts/edgedb_docs.exs" + "run test/support/scripts/edgedb_docs.exs" ] ] end diff --git a/mix.lock b/mix.lock index a7e1df7b..b23bfac2 100644 --- a/mix.lock +++ b/mix.lock @@ -28,7 +28,8 @@ "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, "mox": {:hex, :mox, "1.1.0", "0f5e399649ce9ab7602f72e718305c0f9cdc351190f72844599545e4996af73c", [:mix], [], "hexpm", "d44474c50be02d5b72131070281a5d3895c0e7a95c780e90bc0cfe712f633a13"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, + "nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"}, "panpipe": {:hex, :panpipe, "0.3.0", "388a5541b2baf393b25a84b51eaf36f6d30aa4660f189a8cfad71bee4aebef20", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:protocol_ex, "~> 0.4", [hex: :protocol_ex, repo: "hexpm", optional: false]}, {:rambo, "~> 0.2", [hex: :rambo, repo: "hexpm", optional: false]}], "hexpm", "79d56f9b71dff43def1bc4ee541bf05fab03fbb8367a34295f47b442193bc67a"}, "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, "protocol_ex": {:hex, :protocol_ex, "0.4.4", "c9717d1c0bdabe37d7653965dc02e78580d0d06a1f86d737b7941b55241f70d6", [:mix], [], "hexpm", "2b78ed0e5ec76f62b0debaf92dc8e795551cdaf7fc22b8816b3d57225020ac99"}, diff --git a/pages/md/codegen.md b/pages/md/codegen.md new file mode 100644 index 00000000..7d7975a6 --- /dev/null +++ b/pages/md/codegen.md @@ -0,0 +1,87 @@ +# Code Generation with Elixir client + +`edgedb-elixir` provides a custom `Mix` task for generating Elixir modules from EdgeQL query files. + + +First, add the following lines for `:edgedb` to the config: + +```elixir +config :edgedb, :generation, + queries_path: "priv/edgedb/edgeql/", + output_path: "lib/my_app/edgedb/queries", + module_prefix: MyApp.EdgeDB +``` + +Or in case you have multiple locations for your queries like this: + +```elixir +config :edgedb, + generation: [ + [ + queries_path: "priv/edgedb/edgeql/path1", + output_path: "lib/my_app/edgedb/queries/path1", + module_prefix: MyApp.EdgeDB.Path1 + ], + [ + queries_path: "priv/edgedb/edgeql/path2", + output_path: "lib/my_app/edgedb/queries/path2", + module_prefix: MyApp.EdgeDB.Path2 + ], + ] +``` + +> #### NOTE {: .info} +> +> `module_prefix` is an optional parameter that allows you to control the prefix for the module being generated + +Then, let's place a new EdgeQL query into `priv/edgedb/edgeql/select_string.edgeql`: + +```edgeql +select $arg +``` + +Now we can run `mix edgedb.generate` and it should produce new `lib/my_app/edgedb/queries/select_string.edgeql.ex`. The result should look similar to this: + +```elixir +defmodule MyApp.EdgeDB.SelectString do + @query """ + select $arg + """ + + @type keyword_args() :: [{:arg, String.t() | nil}] + @type map_args() :: %{arg: String.t() | nil} + @type args() :: map_args() | keyword_args() + + @spec query(client :: EdgeDB.client(), args :: args(), opts :: list(EdgeDB.query_option())) :: + {:ok, String.t() | nil} | {:error, reason} when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @spec query!(client :: EdgeDB.client(), args :: args(), opts :: list(EdgeDB.query_option())) :: + String.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + EdgeDB.query_single(client, @query, args, opts) + end +end +``` + +To use it just call the `MyApp.EdgeDB.SelectString.query/3` function: + +```elixir +iex(1)> {:ok, client} = EdgeDB.start_link() +iex(2)> {:ok, "hello world"} = MyApp.EdgeDB.SelectString.query(client, arg: "hello world") +``` + +You can check out a more interesting and complete use case in the example repository: +https://github.com/nsidnev/edgebeats diff --git a/pages/md/main.md b/pages/md/main.md index ca22635a..61920146 100644 --- a/pages/md/main.md +++ b/pages/md/main.md @@ -16,11 +16,6 @@ ## JSON support `EdgeDB` comes with JSON support out of the box via the `Jason` library. - To use it, add `:jason` to your dependencies in the `mix.exs` file: - -```elixir -{:jason, "~> 1.0"} -``` The JSON library can be configured using the `:json` option in the `:edgedb` application configuration: diff --git a/pages/rst/api/api.rst b/pages/rst/api/api.rst index b3cb5cc4..19b16298 100644 --- a/pages/rst/api/api.rst +++ b/pages/rst/api/api.rst @@ -100,6 +100,15 @@ Supported options: - ``:max_concurrency`` - maximum number of pool connections, despite what EdgeDB recommends. - ``:client_state`` - an ``EdgeDB.Client.State`` struct that will be used in queries by default. +*type* ``EdgeDB.params/0`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code:: elixir + + @type EdgeDB.params() :: map() | list() | Keyword.t() + +Parameter types acceptable by ``EdgeDB.query*/4`` functions. + *type* ``EdgeDB.query_option/0`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -232,7 +241,7 @@ See ``EdgeDB.start_option/0`` for supported connection options. .. code:: elixir - @spec EdgeDB.execute(client(), String.t(), list(), [query_option()]) :: :ok | {:error, Exception.t()} + @spec EdgeDB.execute(client(), String.t(), params(), [query_option()]) :: :ok | {:error, Exception.t()} Execute an EdgeQL command or commands on the client without returning anything. @@ -245,7 +254,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.execute!(client(), String.t(), list(), [query_option()]) :: :ok + @spec EdgeDB.execute!(client(), String.t(), params(), [query_option()]) :: :ok Execute an EdgeQL command or commands on the client without returning anything. If an error occurs while executing the query, it will be raised as an ``EdgeDB.Error`` exception. @@ -257,7 +266,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query(client(), String.t(), list() | Keyword.t(), [query_option()]) :: + @spec EdgeDB.query(client(), String.t(), params(), [query_option()]) :: {:ok, result()} | {:error, Exception.t()} Execute the query on the client and return the results as a ``{:ok, set}`` tuple if successful, where ``set`` is ``EdgeDB.Set``. @@ -315,7 +324,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query!(client(), String.t(), list(), [query_option()]) :: result() + @spec EdgeDB.query!(client(), String.t(), params(), [query_option()]) :: result() Execute the query on the client and return the results as ``EdgeDB.Set``. If an error occurs while executing the query, it will be raised as as an ``EdgeDB.Error`` exception. @@ -329,7 +338,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_json(client(), String.t(), list(), [query_option()]) :: + @spec EdgeDB.query_json(client(), String.t(), params(), [query_option()]) :: {:ok, result()} | {:error, Exception.t()} Execute the query on the client and return the results as a ``{:ok, json}`` tuple if successful, where ``json`` is JSON encoded string. @@ -345,7 +354,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_json!(client(), String.t(), list(), [query_option()]) :: result() + @spec EdgeDB.query_json!(client(), String.t(), params(), [query_option()]) :: result() Execute the query on the client and return the results as JSON encoded string. If an error occurs while executing the query, it will be raised as as an ``EdgeDB.Error`` exception. @@ -359,7 +368,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_required_single(client(), String.t(), list(), [query_option()]) :: + @spec EdgeDB.query_required_single(client(), String.t(), params(), [query_option()]) :: {:ok, result()} | {:error, Exception.t()} Execute the query on the client and return a singleton-returning result as a ``{:ok, result}`` tuple. @@ -375,7 +384,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_required_single!(client(), String.t(), list(), [query_option()]) :: result() + @spec EdgeDB.query_required_single!(client(), String.t(), params(), [query_option()]) :: result() Execute the query on the client and return a singleton-returning result. If an error occurs while executing the query, it will be raised as an ``EdgeDB.Error`` exception. @@ -389,7 +398,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_required_single_json(client(), String.t(), list(), [query_option()]) :: + @spec EdgeDB.query_required_single_json(client(), String.t(), params(), [query_option()]) :: {:ok, result()} | {:error, Exception.t()} Execute the query on the client and return a singleton-returning result as a ``{:ok, json}`` tuple. @@ -405,7 +414,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_required_single_json!(client(), String.t(), list(), [query_option()]) :: result() + @spec EdgeDB.query_required_single_json!(client(), String.t(), params(), [query_option()]) :: result() Execute the query on the client and return a singleton-returning result as JSON string. If an error occurs while executing the query, it will be raised as an ``EdgeDB.Error`` exception. @@ -419,7 +428,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_single(client(), String.t(), list(), [query_option()]) :: + @spec EdgeDB.query_single(client(), String.t(), params(), [query_option()]) :: {:ok, result()} | {:error, Exception.t()} Execute the query on the client and return an optional singleton-returning result as a ``{:ok, result}`` tuple. @@ -435,7 +444,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_single!(client(), String.t(), list(), [query_option()]) :: result() + @spec EdgeDB.query_single!(client(), String.t(), params(), [query_option()]) :: result() Execute the query on the client and return an optional singleton-returning result. If an error occurs while executing the query, it will be raised as an ``EdgeDB.Error`` exception. @@ -449,7 +458,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_single_json(client(), String.t(), list(), [query_option()]) :: + @spec EdgeDB.query_single_json(client(), String.t(), params(), [query_option()]) :: {:ok, result()} | {:error, Exception.t()} Execute the query on the client and return an optional singleton-returning result as a ``{:ok, json}`` tuple. @@ -465,7 +474,7 @@ See ``EdgeDB.query_option/0`` for supported options. .. code:: elixir - @spec EdgeDB.query_single_json!(client(), String.t(), list(), [query_option()]) :: result() + @spec EdgeDB.query_single_json!(client(), String.t(), params(), [query_option()]) :: result() Execute the query on the client and return an optional singleton-returning result as JSON encoded string. If an error occurs while executing the query, it will be raised as an ``EdgeDB.Error`` exception. diff --git a/pages/rst/api/edgedb-types.rst b/pages/rst/api/edgedb-types.rst index 8ce6f490..9fa21ac1 100644 --- a/pages/rst/api/edgedb-types.rst +++ b/pages/rst/api/edgedb-types.rst @@ -307,7 +307,7 @@ Get named tuple keys. .. code:: elixir - @spec EdgeDB.NamedTuple.to_map(t()) :: %{required(String.t()) => term()} + @spec EdgeDB.NamedTuple.to_map(t()) :: %{required(String.t() | integer()) => term()} Convert a named tuple into a regular map. @@ -316,7 +316,7 @@ Convert a named tuple into a regular map. iex(1)> {:ok, client} = EdgeDB.start_link() iex(2)> nt = EdgeDB.query_required_single!(client, "select (a := 1, b := 'a', c := [3])") iex(3)> EdgeDB.NamedTuple.to_map(nt) - %{"a" => 1, "b" => "a", "c" => [3]} + %{"a" => 1, 0 => 1, "b" => "a", 1 => "a", "c" => [3], 2 => [3]} *function* ``EdgeDB.NamedTuple.to_tuple(nt)`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pages/rst/codegen.rst b/pages/rst/codegen.rst new file mode 100644 index 00000000..77a60704 --- /dev/null +++ b/pages/rst/codegen.rst @@ -0,0 +1,92 @@ +.. _edgedb-elixir-codegen: + +Code Generation with Elixir client +================================== + +``edgedb-elixir`` provides a custom ``Mix`` task for generating Elixir modules from EdgeQL query files. + +First, add the following lines for ``:edgedb`` to the config: + +.. code:: elixir + + config :edgedb, :generation, + queries_path: "priv/edgedb/edgeql/", + output_path: "lib/my_app/edgedb/queries", + module_prefix: MyApp.EdgeDB + +Or in case you have multiple locations for your queries like this: + +.. code:: elixir + + config :edgedb, + generation: [ + [ + queries_path: "priv/edgedb/edgeql/path1", + output_path: "lib/my_app/edgedb/queries/path1", + module_prefix: MyApp.EdgeDB.Path1 + ], + [ + queries_path: "priv/edgedb/edgeql/path2", + output_path: "lib/my_app/edgedb/queries/path2", + module_prefix: MyApp.EdgeDB.Path2 + ], + ] + +.. + +.. note:: + :name: note-.info + + ``module_prefix`` is an optional parameter that allows you to control the prefix for the module being generated + +Then, let’s place a new EdgeQL query into ``priv/edgedb/edgeql/select_string.edgeql``: + +.. code:: edgeql + + select $arg + +Now we can run ``mix edgedb.generate`` and it should produce new ``lib/my_app/edgedb/queries/select_string.edgeql.ex``. The result should look +similar to this: + +.. code:: elixir + + defmodule MyApp.EdgeDB.SelectString do + @query """ + select $arg + """ + + @type keyword_args() :: [{:arg, String.t() | nil}] + @type map_args() :: %{arg: String.t() | nil} + @type args() :: map_args() | keyword_args() + + @spec query(client :: EdgeDB.client(), args :: args(), opts :: list(EdgeDB.query_option())) :: + {:ok, String.t() | nil} | {:error, reason} when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @spec query!(client :: EdgeDB.client(), args :: args(), opts :: list(EdgeDB.query_option())) :: + String.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + EdgeDB.query_single(client, @query, args, opts) + end + end + +To use it just call the ``MyApp.EdgeDB.SelectString.query/3`` function: + +.. code:: elixir + + iex(1)> {:ok, client} = EdgeDB.start_link() + iex(2)> {:ok, "hello world"} = MyApp.EdgeDB.SelectString.query(client, arg: "hello world") + +You can check out a more interesting and complete use case in the example repository: https://github.com/nsidnev/edgebeats diff --git a/pages/rst/index.rst b/pages/rst/index.rst index e38ea0f3..04a72f64 100644 --- a/pages/rst/index.rst +++ b/pages/rst/index.rst @@ -8,6 +8,7 @@ EdgeDB client for Elixir :hidden: usage + codegen datatypes custom-codecs api/api @@ -32,12 +33,7 @@ dependencies in the ``mix.exs`` file: JSON support ------------ -``EdgeDB`` comes with JSON support out of the box via the ``Jason`` library. To use it, add ``:jason`` to your dependencies in the ``mix.exs`` -file: - -.. code:: elixir - - {:jason, "~> 1.0"} +``EdgeDB`` comes with JSON support out of the box via the ``Jason`` library. The JSON library can be configured using the ``:json`` option in the ``:edgedb`` application configuration: diff --git a/priv/codegen/templates/handlers/_array.eex b/priv/codegen/templates/handlers/_array.eex new file mode 100644 index 00000000..5299fdea --- /dev/null +++ b/priv/codegen/templates/handlers/_array.eex @@ -0,0 +1,3 @@ +for element <- <%= @opts[:variable] %> do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@array.type, Keyword.merge(@opts, variable: "element")) %> +end diff --git a/priv/codegen/templates/handlers/_enum.eex b/priv/codegen/templates/handlers/_enum.eex new file mode 100644 index 00000000..ed1c4357 --- /dev/null +++ b/priv/codegen/templates/handlers/_enum.eex @@ -0,0 +1,5 @@ +case <%= @opts[:variable] %> do + <%= for member <- @enum.members do %> + "<%= member %>" -> :"<%= member %>" + <% end %> +end diff --git a/priv/codegen/templates/handlers/_execute.eex b/priv/codegen/templates/handlers/_execute.eex new file mode 100644 index 00000000..4aab0a61 --- /dev/null +++ b/priv/codegen/templates/handlers/_execute.eex @@ -0,0 +1,4 @@ +defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + EdgeDB.execute(client, @query, args, opts) +end diff --git a/priv/codegen/templates/handlers/_link.eex b/priv/codegen/templates/handlers/_link.eex new file mode 100644 index 00000000..8231fe9c --- /dev/null +++ b/priv/codegen/templates/handlers/_link.eex @@ -0,0 +1,10 @@ +<%= if @link.is_optional do %> +with link when not is_nil(link) <- <%= @opts[:variable] %>["<%= @link.name %>"] do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@link.type, Keyword.merge(@opts, variable: "link")) %> +end +<% else %> +<% variable = EdgeDB.EdgeQL.Generator.Handler.Utils.variable(@link.type, "link") %> +with <%= variable %> <- <%= @opts[:variable] %>["<%= @link.name %>"] do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@link.type, Keyword.merge(@opts, variable: variable)) %> +end +<% end %> diff --git a/priv/codegen/templates/handlers/_multi.eex b/priv/codegen/templates/handlers/_multi.eex new file mode 100644 index 00000000..26f33985 --- /dev/null +++ b/priv/codegen/templates/handlers/_multi.eex @@ -0,0 +1,12 @@ +defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + <%= if EdgeDB.EdgeQL.Generator.Handler.handle?(@query.shape) do %> + <% variable = EdgeDB.EdgeQL.Generator.Handler.Utils.variable(@query.shape, "set") %> + with {:ok, <%= variable %>} <- EdgeDB.query(client, @query, args, opts) do + result = <%= EdgeDB.EdgeQL.Generator.Handler.handle(@query.shape, Keyword.merge(@opts, variable: variable)) %> + {:ok, result} + end + <% else %> + EdgeDB.query(client, @query, args, opts) + <% end %> +end diff --git a/priv/codegen/templates/handlers/_named_tuple.eex b/priv/codegen/templates/handlers/_named_tuple.eex new file mode 100644 index 00000000..cb1884cd --- /dev/null +++ b/priv/codegen/templates/handlers/_named_tuple.eex @@ -0,0 +1,12 @@ +%{ + <%= for element <- @named_tuple.elements do %> + <%= element.name %>: + <%= if EdgeDB.EdgeQL.Generator.Handler.handle?(element.type) do %> + with element <- <%= @opts[:variable] %>["<%= element.name %>"] do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(element.type, Keyword.merge(@opts, variable: "element")) %> + end, + <% else %> + <%= @opts[:variable] %>["<%= element.name %>"], + <% end %> + <% end %> +} diff --git a/priv/codegen/templates/handlers/_object.eex b/priv/codegen/templates/handlers/_object.eex new file mode 100644 index 00000000..e61f96fc --- /dev/null +++ b/priv/codegen/templates/handlers/_object.eex @@ -0,0 +1,13 @@ +%<%= @opts[:module] %>{ + <%= for property <- @object.properties do %> + <%= if property.is_link_property do %> + "@<%= property.name %>": <%= EdgeDB.EdgeQL.Generator.Handler.handle(property, @opts) %>, + <% else %> + <%= property.name %>: <%= EdgeDB.EdgeQL.Generator.Handler.handle(property, @opts) %>, + <% end %> + <% end %> + + <%= for link <- @object.links do %> + <%= link.name %>: <%= EdgeDB.EdgeQL.Generator.Handler.handle(link, @opts) %>, + <% end %> +} diff --git a/priv/codegen/templates/handlers/_property.eex b/priv/codegen/templates/handlers/_property.eex new file mode 100644 index 00000000..5d18ae78 --- /dev/null +++ b/priv/codegen/templates/handlers/_property.eex @@ -0,0 +1,14 @@ +<%= if EdgeDB.EdgeQL.Generator.Handler.handle?(@property) do %> + <%= if @property.is_optional do %> +with property when not is_nil(property) <- <%= @opts[:variable] %>["<%= @property.name %>"] do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@property.type, Keyword.merge(@opts, variable: "property")) %> +end + <% else %> +<% variable = EdgeDB.EdgeQL.Generator.Handler.Utils.variable(@property.type, "property") %> +with <%= variable %> <- <%= @opts[:variable] %>["<%= @property.name %>"] do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@property.type, Keyword.merge(@opts, variable: variable)) %> +end + <% end %> +<% else %> +<%= @opts[:variable] %>["<%= @property.name %>"] +<% end %> diff --git a/priv/codegen/templates/handlers/_required_single.eex b/priv/codegen/templates/handlers/_required_single.eex new file mode 100644 index 00000000..44bfddd4 --- /dev/null +++ b/priv/codegen/templates/handlers/_required_single.eex @@ -0,0 +1,12 @@ +defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + <%= if EdgeDB.EdgeQL.Generator.Handler.handle?(@query.shape) do %> + <% variable = EdgeDB.EdgeQL.Generator.Handler.Utils.variable(@query.shape, "entity") %> + with {:ok, <%= variable %>} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = <%= EdgeDB.EdgeQL.Generator.Handler.handle(@query.shape, Keyword.merge(@opts, variable: variable)) %> + {:ok, result} + end + <% else %> + EdgeDB.query_required_single(client, @query, args, opts) + <% end %> +end diff --git a/priv/codegen/templates/handlers/_set.eex b/priv/codegen/templates/handlers/_set.eex new file mode 100644 index 00000000..2c0449ae --- /dev/null +++ b/priv/codegen/templates/handlers/_set.eex @@ -0,0 +1,4 @@ +<% variable = EdgeDB.EdgeQL.Generator.Handler.Utils.variable(@set.type, "element") %> +for <%= variable %> <- <%= @opts[:variable] %> do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@set.type, Keyword.merge(@opts, variable: variable)) %> +end diff --git a/priv/codegen/templates/handlers/_shape.eex b/priv/codegen/templates/handlers/_shape.eex new file mode 100644 index 00000000..a2051df8 --- /dev/null +++ b/priv/codegen/templates/handlers/_shape.eex @@ -0,0 +1,15 @@ +<%= cond do %> + <% @shape.is_multi -> %> +<% variable = EdgeDB.EdgeQL.Generator.Handler.Utils.variable(@shape.type, "element") %> +for <%= variable %> <- <%= @opts[:variable] %> do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@shape.type, Keyword.merge(@opts, variable: variable)) %> +end + + <% @shape.is_optional -> %> +with element when not is_nil(element) <- <%= @opts[:variable] %> do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@shape.type, Keyword.merge(@opts, variable: "element")) %> +end + + <% true -> %> +<%= EdgeDB.EdgeQL.Generator.Handler.handle(@shape.type, @opts) %> +<% end %> diff --git a/priv/codegen/templates/handlers/_single.eex b/priv/codegen/templates/handlers/_single.eex new file mode 100644 index 00000000..e4be9491 --- /dev/null +++ b/priv/codegen/templates/handlers/_single.eex @@ -0,0 +1,11 @@ +defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + <%= if EdgeDB.EdgeQL.Generator.Handler.handle?(@query.shape) do %> + with {:ok, entity} when not is_nil(entity) <- EdgeDB.query_single(client, @query, args, opts) do + result = <%= EdgeDB.EdgeQL.Generator.Handler.handle(@query.shape, Keyword.merge(@opts, variable: "entity")) %> + {:ok, result} + end + <% else %> + EdgeDB.query_single(client, @query, args, opts) + <% end %> +end diff --git a/priv/codegen/templates/handlers/_tuple.eex b/priv/codegen/templates/handlers/_tuple.eex new file mode 100644 index 00000000..ca058045 --- /dev/null +++ b/priv/codegen/templates/handlers/_tuple.eex @@ -0,0 +1,17 @@ +with { + <%= for {_element, idx} <- Enum.with_index(@tuple.elements) do %> + element_<%= idx %>, + <% end %> +} <- <%= @opts[:variable] %> do + { + <%= for {element, idx} <- Enum.with_index(@tuple.elements) do %> + <%= if EdgeDB.EdgeQL.Generator.Handler.handle?(element) do %> + with element <- element_<%= idx %> do + <%= EdgeDB.EdgeQL.Generator.Handler.handle(element, Keyword.merge(@opts, variable: "element")) %> + end, + <% else %> + element_<%= idx %>, + <% end %> + <% end %> + } +end diff --git a/priv/codegen/templates/modules/_args.eex b/priv/codegen/templates/modules/_args.eex new file mode 100644 index 00000000..55fff5be --- /dev/null +++ b/priv/codegen/templates/modules/_args.eex @@ -0,0 +1 @@ +<%= Enum.map_join(@args.args, ", ", &("arg_#{&1.name}")) %> diff --git a/priv/codegen/templates/modules/_link.eex b/priv/codegen/templates/modules/_link.eex new file mode 100644 index 00000000..30c71a4a --- /dev/null +++ b/priv/codegen/templates/modules/_link.eex @@ -0,0 +1 @@ +<%= EdgeDB.EdgeQL.Generator.Render.render(@link.type, :module, @opts) %> diff --git a/priv/codegen/templates/modules/_object.eex b/priv/codegen/templates/modules/_object.eex new file mode 100644 index 00000000..e48d6bf0 --- /dev/null +++ b/priv/codegen/templates/modules/_object.eex @@ -0,0 +1,35 @@ +defmodule <%= @opts[:module] %> do + @moduledoc false + + <%= for link <- @object.links do %> + <%= EdgeDB.EdgeQL.Generator.Render.render(link, :module, @opts) %> + <% end %> + + defstruct [ + <%= for property <- @object.properties do %> + <%= if property.is_link_property do %> + :"@<%= property.name %>", + <% else %> + :<%= property.name %>, + <% end %> + <% end %> + + <%= for link <- @object.links do %> + :<%= link.name %>, + <% end %> + ] + + @type t() :: %__MODULE__{ + <%= for property <- @object.properties do %> + <%= if property.is_link_property do %> + "@<%= property.name %>": <%= EdgeDB.EdgeQL.Generator.Render.render(property, :typespec, @opts) %>, + <% else %> + <%= property.name %>: <%= EdgeDB.EdgeQL.Generator.Render.render(property, :typespec, @opts) %>, + <% end %> + <% end %> + + <%= for link <- @object.links do %> + <%= link.name %>: <%= EdgeDB.EdgeQL.Generator.Render.render(link, :typespec, @opts) %>, + <% end %> + } +end diff --git a/priv/codegen/templates/modules/query.ex.eex b/priv/codegen/templates/modules/query.ex.eex new file mode 100644 index 00000000..094a6cc7 --- /dev/null +++ b/priv/codegen/templates/modules/query.ex.eex @@ -0,0 +1,143 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `<%= @query.file %>`. +defmodule <%= @query.module %> do + @query """ +<%= String.trim_trailing(@query.query, "\n") %> +""" + + @moduledoc """ + Generated module for the EdgeQL query from + `<%= @query.file %>`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "<%= @query.file %>" + + <%= for {type_name, {typedoc, typespec}} <- @query.types do %> + @typedoc """ + ```edgeql + <%= typedoc %> + ``` + """ + @type <%= type_name %> :: <%= typespec %> + <% end %> + + <%= if EdgeDB.EdgeQL.Generator.Shape.complex?(@query.shape) do %> + <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :module, @opts) %> + <% end %> + + <%= if @query.args.is_positional do %> + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + <%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, :spec, @opts) %>, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :typespec, @opts) %>} | {:error, reason} when reason: any() + def query(client, <%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, :args, @opts) %>, opts \\ []) do + args = [<%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, :args, @opts) %>] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + <%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, :spec, @opts) %>, + opts :: list(EdgeDB.query_option()) + ) :: <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :typespec, @opts) %> + def query!(client, <%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, :args, @opts) %>, opts \\ []) do + args = [<%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, :args, @opts) %>] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + <% end %> + + <%= if @query.args.is_named do %> + + @type keyword_args() :: <%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, {:typespec, :keyword}, @opts) %> + @type map_args() :: <%= EdgeDB.EdgeQL.Generator.Render.render(@query.args, {:typespec, :map}, @opts) %> + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :typespec, @opts) %>} | {:error, reason} when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :typespec, @opts) %> + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + <% end %> + + <%= if @query.args.is_empty do %> + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :typespec, @opts) %>} | {:error, reason} when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :typespec, @opts) %> + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + <% end %> + + <%= EdgeDB.EdgeQL.Generator.Handler.handle(@query, @opts) %> +end diff --git a/priv/codegen/templates/typespecs/_arg.eex b/priv/codegen/templates/typespecs/_arg.eex new file mode 100644 index 00000000..54c28eff --- /dev/null +++ b/priv/codegen/templates/typespecs/_arg.eex @@ -0,0 +1,5 @@ +<%= EdgeDB.EdgeQL.Generator.Render.render(@arg.type, :typespec, @opts) %> + +<%= if @arg.is_optional do %> +| nil +<% end %> diff --git a/priv/codegen/templates/typespecs/_args.eex b/priv/codegen/templates/typespecs/_args.eex new file mode 100644 index 00000000..a534f986 --- /dev/null +++ b/priv/codegen/templates/typespecs/_args.eex @@ -0,0 +1 @@ +<%= Enum.map_join(@args.args, ", ", &("arg_#{&1.name} :: #{EdgeDB.EdgeQL.Generator.Render.render(&1, :typespec, @opts)}")) %> diff --git a/priv/codegen/templates/typespecs/_args_keyword.eex b/priv/codegen/templates/typespecs/_args_keyword.eex new file mode 100644 index 00000000..bb3c5596 --- /dev/null +++ b/priv/codegen/templates/typespecs/_args_keyword.eex @@ -0,0 +1 @@ +[<%= Enum.map_join(@args.args, " | ", &("{:#{&1.name}, #{EdgeDB.EdgeQL.Generator.Render.render(&1, :typespec, @opts)}}")) %>] diff --git a/priv/codegen/templates/typespecs/_args_map.eex b/priv/codegen/templates/typespecs/_args_map.eex new file mode 100644 index 00000000..7d94c96c --- /dev/null +++ b/priv/codegen/templates/typespecs/_args_map.eex @@ -0,0 +1,5 @@ +%{ +<%= for arg <- @args.args do %> + <%= arg.name %>: <%= EdgeDB.EdgeQL.Generator.Render.render(arg, :typespec, @opts) %>, +<% end %> +} diff --git a/priv/codegen/templates/typespecs/_array.eex b/priv/codegen/templates/typespecs/_array.eex new file mode 100644 index 00000000..ee72b232 --- /dev/null +++ b/priv/codegen/templates/typespecs/_array.eex @@ -0,0 +1 @@ +[<%= EdgeDB.EdgeQL.Generator.Render.render(@array.type, :typespec, @opts) %>] diff --git a/priv/codegen/templates/typespecs/_enum.eex b/priv/codegen/templates/typespecs/_enum.eex new file mode 100644 index 00000000..6b53958d --- /dev/null +++ b/priv/codegen/templates/typespecs/_enum.eex @@ -0,0 +1,5 @@ +<%= if not is_nil(@enum.module) and not @opts[:root] do %> +<%= @enum.module %>.<%= @enum.typespec %> +<% else %> +<%= @enum.typespec %> +<% end %> diff --git a/priv/codegen/templates/typespecs/_link.eex b/priv/codegen/templates/typespecs/_link.eex new file mode 100644 index 00000000..b79f7514 --- /dev/null +++ b/priv/codegen/templates/typespecs/_link.eex @@ -0,0 +1,9 @@ +<%= if @link.is_multi do %> +<%= EdgeDB.EdgeQL.Generator.Render.render(@link.type, :typespec, @opts) %> +<% else %> +<%= EdgeDB.EdgeQL.Generator.Render.render(@link.type, :typespec, @opts) %> +<% end %> + +<%= if @link.is_optional do %> +| nil +<% end %> diff --git a/priv/codegen/templates/typespecs/_named_tuple.eex b/priv/codegen/templates/typespecs/_named_tuple.eex new file mode 100644 index 00000000..f39d620a --- /dev/null +++ b/priv/codegen/templates/typespecs/_named_tuple.eex @@ -0,0 +1,5 @@ +%{ + <%= for element <- @named_tuple.elements do %> + <%= element.name %>: <%= EdgeDB.EdgeQL.Generator.Render.render(element, :typespec, @opts) %>, + <% end %> +} diff --git a/priv/codegen/templates/typespecs/_object.eex b/priv/codegen/templates/typespecs/_object.eex new file mode 100644 index 00000000..45fc3b06 --- /dev/null +++ b/priv/codegen/templates/typespecs/_object.eex @@ -0,0 +1 @@ +<%= @opts[:module] %>.t() diff --git a/priv/codegen/templates/typespecs/_property.eex b/priv/codegen/templates/typespecs/_property.eex new file mode 100644 index 00000000..cfde8964 --- /dev/null +++ b/priv/codegen/templates/typespecs/_property.eex @@ -0,0 +1,9 @@ +<%= if @property.is_multi do %> +<%= EdgeDB.EdgeQL.Generator.Render.render(@property.type, :typespec, @opts) %> +<% else %> +<%= EdgeDB.EdgeQL.Generator.Render.render(@property.type, :typespec, @opts) %> +<% end %> + +<%= if @property.is_optional do %> +| nil +<% end %> diff --git a/priv/codegen/templates/typespecs/_query_pure.eex b/priv/codegen/templates/typespecs/_query_pure.eex new file mode 100644 index 00000000..14313b4f --- /dev/null +++ b/priv/codegen/templates/typespecs/_query_pure.eex @@ -0,0 +1,6 @@ +<%= if EdgeDB.EdgeQL.Generator.Shape.complex?(@query.shape) do %> +{:ok, <%= EdgeDB.EdgeQL.Generator.Render.render(@query.shape, :typespec, @opts) %>} +<% else %> +:ok +<% end %> +| {:error, reason} when reason: any() diff --git a/priv/codegen/templates/typespecs/_range.eex b/priv/codegen/templates/typespecs/_range.eex new file mode 100644 index 00000000..f4d62b7a --- /dev/null +++ b/priv/codegen/templates/typespecs/_range.eex @@ -0,0 +1,5 @@ +<%= if @range.is_multirange do %> +EdgeDB.MultiRange.t(<%= EdgeDB.EdgeQL.Generator.Render.render(@range.type, :typespec, @opts) %>) +<% else %> +EdgeDB.Range.t(<%= EdgeDB.EdgeQL.Generator.Render.render(@range.type, :typespec, @opts) %>) +<% end %> diff --git a/priv/codegen/templates/typespecs/_scalar.eex b/priv/codegen/templates/typespecs/_scalar.eex new file mode 100644 index 00000000..4e02d69d --- /dev/null +++ b/priv/codegen/templates/typespecs/_scalar.eex @@ -0,0 +1,5 @@ +<%= if not is_nil(@scalar.module) and not @opts[:root] do %> +<%= @scalar.module %>.<%= @scalar.typespec %> +<% else %> +<%= @scalar.typespec %> +<% end %> diff --git a/priv/codegen/templates/typespecs/_set.eex b/priv/codegen/templates/typespecs/_set.eex new file mode 100644 index 00000000..ee75c12a --- /dev/null +++ b/priv/codegen/templates/typespecs/_set.eex @@ -0,0 +1 @@ +[<%= EdgeDB.EdgeQL.Generator.Render.render(@set.type, :typespec, @opts) %>] diff --git a/priv/codegen/templates/typespecs/_shape.eex b/priv/codegen/templates/typespecs/_shape.eex new file mode 100644 index 00000000..3fd65aac --- /dev/null +++ b/priv/codegen/templates/typespecs/_shape.eex @@ -0,0 +1,11 @@ +<%= if @shape.is_multi do %> +[ +<%= EdgeDB.EdgeQL.Generator.Render.render(@shape.type, :typespec, @opts) %> +] +<% else %> +<%= EdgeDB.EdgeQL.Generator.Render.render(@shape.type, :typespec, @opts) %> +<% end %> + +<%= if @shape.is_optional do %> +| nil +<% end %> diff --git a/priv/codegen/templates/typespecs/_tuple.eex b/priv/codegen/templates/typespecs/_tuple.eex new file mode 100644 index 00000000..ffe57f46 --- /dev/null +++ b/priv/codegen/templates/typespecs/_tuple.eex @@ -0,0 +1 @@ +{<%= Enum.map_join(@tuple.elements, ", ", &EdgeDB.EdgeQL.Generator.Render.render(&1, :typespec, @opts)) %>} diff --git a/priv/scripts/drop-roles.sh b/priv/scripts/drop-roles.sh deleted file mode 100755 index 6f27712f..00000000 --- a/priv/scripts/drop-roles.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e - -edgedb query --file priv/scripts/edgeql/drop-roles.edgeql diff --git a/priv/scripts/setup-roles.sh b/priv/scripts/setup-roles.sh deleted file mode 100755 index 3fc5b897..00000000 --- a/priv/scripts/setup-roles.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e - -edgedb query --file priv/scripts/edgeql/setup-roles.edgeql diff --git a/test/codegen/codegen_test.exs b/test/codegen/codegen_test.exs new file mode 100644 index 00000000..c8e0109d --- /dev/null +++ b/test/codegen/codegen_test.exs @@ -0,0 +1,95 @@ +defmodule Tests.CodegenTest do + use Tests.Support.EdgeDBCase + + skip_before(version: 4, scope: :module) + + @queries_path Application.compile_env!(:edgedb, :generation)[:queries_path] + + queries = + [@queries_path, "**", "*.edgeql"] + |> Path.join() + |> Path.wildcard() + + setup :edgedb_client + + describe "queries generation" do + setup do + {:ok, files} = EdgeDB.EdgeQL.Generator.generate(silent: true) + + Code.put_compiler_option(:ignore_module_conflict, true) + + on_exit(fn -> + Code.put_compiler_option(:ignore_module_conflict, false) + end) + + %{files: files} + end + + test "codegen returns an atomized map for named tuple", %{client: client, files: files} do + [{mod, _code}] = + files + |> Enum.find(fn {_query_file, elixir_file} -> + String.contains?(elixir_file, "tuple/named/named.required") + end) + |> elem(1) + |> Code.compile_file() + + assert %{a: "test", b: true} = mod.query!(client, arg: %{a: "test", b: true}) + end + + test "codegen returns an atom for an enum", %{client: client, files: files} do + [{mod, _code}] = + files + |> Enum.find(fn {_query_file, elixir_file} -> + String.contains?(elixir_file, "enum/named.required") + end) + |> elem(1) + |> Code.compile_file() + + assert :A = mod.query!(client, arg: :A) + end + + test "generated module equals the desired module state", %{files: files} do + tasks = + for query_path <- unquote(queries) do + Task.async(fn -> + assert %{^query_path => elixir_path} = files + + prepared_module = + "#{query_path}.ex.assert" + |> File.read!() + |> Code.format_string!() + |> IO.iodata_to_binary() + + generated_module = + elixir_path + |> File.read!() + |> Code.format_string!() + |> IO.iodata_to_binary() + + assert String.trim(prepared_module) == String.trim(generated_module) + :ok + end) + end + + for result <- Task.await_many(tasks, :timer.seconds(10)) do + assert :ok = result + end + end + + test "generated module compiles", %{files: files} do + tasks = + for query_path <- unquote(queries) do + Task.async(fn -> + assert %{^query_path => elixir_path} = files + assert [{_module, _binary} | _rest] = Code.compile_file(elixir_path) + :ok + end) + end + + for result <- Task.await_many(tasks, :timer.seconds(10)) do + assert :ok = result + end + end + end +end diff --git a/test/edgedb/api_test.exs b/test/edgedb/api_test.exs index 6a2c6bee..a5b25bf5 100644 --- a/test/edgedb/api_test.exs +++ b/test/edgedb/api_test.exs @@ -398,8 +398,7 @@ defmodule Tests.EdgeDB.APITest do setup %{client: client} do %{ - client: - EdgeDB.with_module_aliases(client, %{"schema_alias" => "schema", "cfg_alias" => "cfg"}) + client: EdgeDB.with_module_aliases(client, %{"schema_alias" => "schema", "cfg_alias" => "cfg"}) } end diff --git a/test/edgedb/connection/state_test.exs b/test/edgedb/connection/state_test.exs index 64a08b42..98e3a7dc 100644 --- a/test/edgedb/connection/state_test.exs +++ b/test/edgedb/connection/state_test.exs @@ -81,10 +81,7 @@ defmodule Tests.EdgeDB.Connection.StateTest do } do {:ok, client} = start_supervised( - {EdgeDB, - tls_security: :insecure, - max_concurrency: 1, - show_sensitive_data_on_connection_error: true} + {EdgeDB, tls_security: :insecure, max_concurrency: 1, show_sensitive_data_on_connection_error: true} ) object = diff --git a/test/edgedb/pool/edgedb_pool_test.exs b/test/edgedb/pool/edgedb_pool_test.exs index 67c8838a..b6abd2ef 100644 --- a/test/edgedb/pool/edgedb_pool_test.exs +++ b/test/edgedb/pool/edgedb_pool_test.exs @@ -9,10 +9,7 @@ defmodule Tests.EdgeDB.Pool.EdgeDBPoolTest do setup do {:ok, client} = start_supervised( - {EdgeDB, - connection: PoolConnection, - idle_interval: 50, - show_sensitive_data_on_connection_error: true} + {EdgeDB, connection: PoolConnection, idle_interval: 50, show_sensitive_data_on_connection_error: true} ) %{client: client} @@ -32,10 +29,7 @@ defmodule Tests.EdgeDB.Pool.EdgeDBPoolTest do setup do {:ok, client} = start_supervised( - {EdgeDB, - connection: PoolConnection, - idle_interval: 50, - show_sensitive_data_on_connection_error: true} + {EdgeDB, connection: PoolConnection, idle_interval: 50, show_sensitive_data_on_connection_error: true} ) :executed = EdgeDB.query_required_single!(client, "select 1") diff --git a/test/edgedb/protocol/codecs/bigint_test.exs b/test/edgedb/protocol/codecs/bigint_test.exs index 0387d0a7..0f84eda4 100644 --- a/test/edgedb/protocol/codecs/bigint_test.exs +++ b/test/edgedb/protocol/codecs/bigint_test.exs @@ -28,9 +28,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.BigIntTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::bigint: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::bigint: #{inspect(value)}") end test "error when passing float as std::bigint argument", %{client: client} do diff --git a/test/edgedb/protocol/codecs/bool_test.exs b/test/edgedb/protocol/codecs/bool_test.exs index d963a28d..35fa271f 100644 --- a/test/edgedb/protocol/codecs/bool_test.exs +++ b/test/edgedb/protocol/codecs/bool_test.exs @@ -23,8 +23,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.BoolTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::bool: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::bool: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/bytes_test.exs b/test/edgedb/protocol/codecs/bytes_test.exs index 8987de04..88afdeee 100644 --- a/test/edgedb/protocol/codecs/bytes_test.exs +++ b/test/edgedb/protocol/codecs/bytes_test.exs @@ -22,8 +22,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.BytesTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::bytes: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::bytes: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/config_memory_test.exs b/test/edgedb/protocol/codecs/config_memory_test.exs index 638b1ec1..415525aa 100644 --- a/test/edgedb/protocol/codecs/config_memory_test.exs +++ b/test/edgedb/protocol/codecs/config_memory_test.exs @@ -33,9 +33,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.ConfigMemoryTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cfg::memory: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as cfg::memory: #{inspect(value)}") end test "error when passing invalid entity as cfg::memory argument", %{client: client} do @@ -47,8 +45,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.ConfigMemoryTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as cfg::memory: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as cfg::memory: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/decimal_test.exs b/test/edgedb/protocol/codecs/decimal_test.exs index 7c0f3407..f7c4e11b 100644 --- a/test/edgedb/protocol/codecs/decimal_test.exs +++ b/test/edgedb/protocol/codecs/decimal_test.exs @@ -34,9 +34,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.DecimalTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::decimal: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::decimal: #{inspect(value)}") end test "error when passing non-number Decimal as std::decimal argument", %{client: client} do diff --git a/test/edgedb/protocol/codecs/enum_test.exs b/test/edgedb/protocol/codecs/enum_test.exs index 77bf54c2..4844b994 100644 --- a/test/edgedb/protocol/codecs/enum_test.exs +++ b/test/edgedb/protocol/codecs/enum_test.exs @@ -22,8 +22,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.EnumTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as enum: not enum member: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as enum: not enum member: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/float32_test.exs b/test/edgedb/protocol/codecs/float32_test.exs index 71c7634b..39eddf0f 100644 --- a/test/edgedb/protocol/codecs/float32_test.exs +++ b/test/edgedb/protocol/codecs/float32_test.exs @@ -52,8 +52,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Flaot32Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::float32: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::float32: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/float64_test.exs b/test/edgedb/protocol/codecs/float64_test.exs index 5a07a7d9..5272f253 100644 --- a/test/edgedb/protocol/codecs/float64_test.exs +++ b/test/edgedb/protocol/codecs/float64_test.exs @@ -52,8 +52,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Flaot64Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::float64: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::float64: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/int16_test.exs b/test/edgedb/protocol/codecs/int16_test.exs index 9b0a68c7..68af040d 100644 --- a/test/edgedb/protocol/codecs/int16_test.exs +++ b/test/edgedb/protocol/codecs/int16_test.exs @@ -22,9 +22,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int16Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int16: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int16: #{inspect(value)}") end test "error when passing too large number as std::int16 argument", %{client: client} do @@ -36,9 +34,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int16Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int16: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int16: #{inspect(value)}") end test "error when passing too small number as std::int16 argument", %{client: client} do @@ -50,8 +46,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int16Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int16: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int16: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/int32_test.exs b/test/edgedb/protocol/codecs/int32_test.exs index f1e45c0f..cb07fa9b 100644 --- a/test/edgedb/protocol/codecs/int32_test.exs +++ b/test/edgedb/protocol/codecs/int32_test.exs @@ -22,9 +22,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int32Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int32: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int32: #{inspect(value)}") end test "error when passing too large number as std::int32 argument", %{client: client} do @@ -36,9 +34,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int32Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int32: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int32: #{inspect(value)}") end test "error when passing too small number as std::int32 argument", %{client: client} do @@ -50,8 +46,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int32Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int32: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int32: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/int64_test.exs b/test/edgedb/protocol/codecs/int64_test.exs index 38e10e8a..e28e16da 100644 --- a/test/edgedb/protocol/codecs/int64_test.exs +++ b/test/edgedb/protocol/codecs/int64_test.exs @@ -22,9 +22,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int64Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int64: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int64: #{inspect(value)}") end test "error when passing too large number as std::int64 argument", %{client: client} do @@ -36,9 +34,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int64Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int64: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int64: #{inspect(value)}") end test "error when passing too small number as std::int64 argument", %{client: client} do @@ -50,8 +46,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.Int64Test do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::int64: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::int64: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/range_test.exs b/test/edgedb/protocol/codecs/range_test.exs index 0e7b0328..e033f797 100644 --- a/test/edgedb/protocol/codecs/range_test.exs +++ b/test/edgedb/protocol/codecs/range_test.exs @@ -45,8 +45,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.RangeTest do {EdgeDB.Range.new(~U[2022-07-01 00:00:00Z], ~U[2022-12-01 00:00:00Z], inc_upper: true), EdgeDB.Range.new(~U[2022-07-01 00:00:00Z], ~U[2022-12-01 00:00:00Z], inc_upper: true)}, EdgeDB.Range.empty(), - {EdgeDB.Range.new(~U[2022-07-01 00:00:00Z], ~U[2022-07-01 00:00:00Z]), - EdgeDB.Range.empty()}, + {EdgeDB.Range.new(~U[2022-07-01 00:00:00Z], ~U[2022-07-01 00:00:00Z]), EdgeDB.Range.empty()}, EdgeDB.Range.new(nil, nil) ], "range" => [ @@ -54,8 +53,7 @@ defmodule Tests.EdgeDB.Protocol.Codecs.RangeTest do {EdgeDB.Range.new(~N[2022-07-01 00:00:00Z], ~N[2022-12-01 00:00:00Z], inc_upper: true), EdgeDB.Range.new(~N[2022-07-01 00:00:00Z], ~N[2022-12-01 00:00:00Z], inc_upper: true)}, EdgeDB.Range.empty(), - {EdgeDB.Range.new(~N[2022-07-01 00:00:00Z], ~N[2022-07-01 00:00:00Z]), - EdgeDB.Range.empty()}, + {EdgeDB.Range.new(~N[2022-07-01 00:00:00Z], ~N[2022-07-01 00:00:00Z]), EdgeDB.Range.empty()}, EdgeDB.Range.new(nil, nil) ], "range" => [ diff --git a/test/edgedb/protocol/codecs/str_test.exs b/test/edgedb/protocol/codecs/str_test.exs index bffc05ba..2cbc1fd4 100644 --- a/test/edgedb/protocol/codecs/str_test.exs +++ b/test/edgedb/protocol/codecs/str_test.exs @@ -24,8 +24,6 @@ defmodule Tests.EdgeDB.Protocol.Codecs.StrTest do end assert exc == - EdgeDB.InvalidArgumentError.new( - "value can not be encoded as std::str: #{inspect(value)}" - ) + EdgeDB.InvalidArgumentError.new("value can not be encoded as std::str: #{inspect(value)}") end end diff --git a/test/edgedb/protocol/codecs/tuple_test.exs b/test/edgedb/protocol/codecs/tuple_test.exs index f1abfead..effe9bc4 100644 --- a/test/edgedb/protocol/codecs/tuple_test.exs +++ b/test/edgedb/protocol/codecs/tuple_test.exs @@ -20,16 +20,12 @@ defmodule Tests.EdgeDB.Protocol.Codecs.TupleTest do value = {1, "string", true, 1.0} assert ^value = - EdgeDB.query_single!(client, "select >$arg", - arg: value - ) + EdgeDB.query_single!(client, "select >$arg", arg: value) end test "as optional named query argument", %{client: client} do result = - EdgeDB.query_single!(client, "select >$arg", - arg: nil - ) + EdgeDB.query_single!(client, "select >$arg", arg: nil) assert is_nil(result) end diff --git a/test/edgedb/types/named_tuple_test.exs b/test/edgedb/types/named_tuple_test.exs index 3ec1f4a0..0dc4ef70 100644 --- a/test/edgedb/types/named_tuple_test.exs +++ b/test/edgedb/types/named_tuple_test.exs @@ -37,7 +37,9 @@ defmodule Tests.EdgeDB.Types.NamedTupleTest do describe "EdgeDB.NamedTuple.to_map/1" do test "returns map converted from object", %{client: client} do nt = EdgeDB.query_required_single!(client, select_named_tuple_query()) - expected_map = Enum.into(1..100, %{}, &{"key_#{&1}", &1}) + expected_keys_map = Enum.into(1..100, %{}, &{"key_#{&1}", &1}) + expected_index_map = Enum.into(1..100, %{}, &{&1 - 1, &1}) + expected_map = Map.merge(expected_keys_map, expected_index_map) assert EdgeDB.NamedTuple.to_map(nt) == expected_map end diff --git a/test/shared/connection_test.exs b/test/shared/connection_test.exs index d73e23db..c608966a 100644 --- a/test/shared/connection_test.exs +++ b/test/shared/connection_test.exs @@ -46,9 +46,7 @@ if File.exists?(testcases_file) do }, "exclusive_options" => { EdgeDB.Error, - type: EdgeDB.ClientConnectionError, - name: "ClientConnectionError", - message: ~r/are mutually exclusive/ + type: EdgeDB.ClientConnectionError, name: "ClientConnectionError", message: ~r/are mutually exclusive/ }, "env_not_found" => {RuntimeError, message: ~r/environment variable ".*" doesn't exist/}, "file_not_found" => {File.Error, message: ~r/could not read/}, @@ -59,9 +57,7 @@ if File.exists?(testcases_file) do }, "invalid_secret_key" => {EdgeDB.Error, - type: EdgeDB.ClientConnectionError, - name: "ClientConnectionError", - message: ~r/invalid secret key/}, + type: EdgeDB.ClientConnectionError, name: "ClientConnectionError", message: ~r/invalid secret key/}, "secret_key_not_found" => {EdgeDB.Error, type: EdgeDB.ClientConnectionError, diff --git a/test/support/codecs/ticket_no.ex b/test/support/codecs/ticket_no.ex index 3878c954..49fb1459 100644 --- a/test/support/codecs/ticket_no.ex +++ b/test/support/codecs/ticket_no.ex @@ -27,9 +27,7 @@ defimpl EdgeDB.Protocol.Codec, for: Tests.Support.Codecs.TicketNo do @impl Codec def encode(_codec, value, _codec_storage) do - raise EdgeDB.InvalidArgumentError.new( - "value can not be encoded as v1::TicketNo: #{inspect(value)}" - ) + raise EdgeDB.InvalidArgumentError.new("value can not be encoded as v1::TicketNo: #{inspect(value)}") end @impl Codec diff --git a/test/support/codegen/edgeql/primitives/array/literal.edgeql b/test/support/codegen/edgeql/primitives/array/literal.edgeql new file mode 100644 index 00000000..ce60af7d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/literal.edgeql @@ -0,0 +1 @@ +select ["a", "b", "c"] diff --git a/test/support/codegen/edgeql/primitives/array/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/array/literal.edgeql.ex.assert new file mode 100644 index 00000000..4dc5f97b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/array/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Array.Literal do + @query """ + select ["a", "b", "c"] + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/array/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/array/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [String.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [String.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/array/named.optional.edgeql b/test/support/codegen/edgeql/primitives/array/named.optional.edgeql new file mode 100644 index 00000000..17b8c05f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/array/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/array/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..5eae7d9f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/array/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Array.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/array/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/array/named.optional.edgeql" + + @type keyword_args() :: [{:arg, [String.t()] | nil}] + @type map_args() :: %{arg: [String.t()] | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [String.t()] | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: [String.t()] | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/array/named.required.edgeql b/test/support/codegen/edgeql/primitives/array/named.required.edgeql new file mode 100644 index 00000000..3980d426 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/array/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/array/named.required.edgeql.ex.assert new file mode 100644 index 00000000..e82b1bf2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/array/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Array.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/array/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/array/named.required.edgeql" + + @type keyword_args() :: [{:arg, [String.t()]}] + @type map_args() :: %{arg: [String.t()]} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [String.t()]} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: [String.t()] + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/array/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/array/positional.optional.edgeql new file mode 100644 index 00000000..4f7a1459 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/array/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/array/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..c5a4c6c8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/array/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Array.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/array/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/array/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: [String.t()] | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [String.t()] | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: [String.t()] | nil, + opts :: list(EdgeDB.query_option()) + ) :: [String.t()] | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/array/positional.required.edgeql b/test/support/codegen/edgeql/primitives/array/positional.required.edgeql new file mode 100644 index 00000000..e890ef02 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/array/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/array/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..c1484ddf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/array/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/array/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Array.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/array/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/array/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: [String.t()], + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [String.t()]} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: [String.t()], + opts :: list(EdgeDB.query_option()) + ) :: [String.t()] + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/enum/literal.edgeql b/test/support/codegen/edgeql/primitives/enum/literal.edgeql new file mode 100644 index 00000000..2d6c5839 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/literal.edgeql @@ -0,0 +1 @@ +select v4::codegen::EnumType.A diff --git a/test/support/codegen/edgeql/primitives/enum/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/enum/literal.edgeql.ex.assert new file mode 100644 index 00000000..b53043ea --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/literal.edgeql.ex.assert @@ -0,0 +1,72 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/enum/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Enum.Literal do + @query """ + select v4::codegen::EnumType.A + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/enum/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/enum/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::EnumType extending enum + ``` + """ + @type v4__codegen__enum_type() :: :A | :B | :C + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__enum_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__enum_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + case entity do + "A" -> :A + "B" -> :B + "C" -> :C + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/enum/named.optional.edgeql b/test/support/codegen/edgeql/primitives/enum/named.optional.edgeql new file mode 100644 index 00000000..1f767a87 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/enum/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/enum/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..383e12f5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/named.optional.edgeql.ex.assert @@ -0,0 +1,80 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/enum/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Enum.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/enum/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/enum/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::EnumType extending enum + ``` + """ + @type v4__codegen__enum_type() :: :A | :B | :C + + @type keyword_args() :: [{:arg, v4__codegen__enum_type() | nil}] + @type map_args() :: %{arg: v4__codegen__enum_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__enum_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__enum_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} when not is_nil(entity) <- EdgeDB.query_single(client, @query, args, opts) do + result = + with element when not is_nil(element) <- entity do + case element do + "A" -> :A + "B" -> :B + "C" -> :C + end + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/enum/named.required.edgeql b/test/support/codegen/edgeql/primitives/enum/named.required.edgeql new file mode 100644 index 00000000..2fa345c2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/enum/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/enum/named.required.edgeql.ex.assert new file mode 100644 index 00000000..830b29fe --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/named.required.edgeql.ex.assert @@ -0,0 +1,78 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/enum/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Enum.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/enum/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/enum/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::EnumType extending enum + ``` + """ + @type v4__codegen__enum_type() :: :A | :B | :C + + @type keyword_args() :: [{:arg, v4__codegen__enum_type()}] + @type map_args() :: %{arg: v4__codegen__enum_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__enum_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__enum_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + case entity do + "A" -> :A + "B" -> :B + "C" -> :C + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql new file mode 100644 index 00000000..7bb3203b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..2b6009e7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql.ex.assert @@ -0,0 +1,79 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Enum.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/enum/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::EnumType extending enum + ``` + """ + @type v4__codegen__enum_type() :: :A | :B | :C + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__enum_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__enum_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__enum_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__enum_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} when not is_nil(entity) <- EdgeDB.query_single(client, @query, args, opts) do + result = + with element when not is_nil(element) <- entity do + case element do + "A" -> :A + "B" -> :B + "C" -> :C + end + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/enum/positional.required.edgeql b/test/support/codegen/edgeql/primitives/enum/positional.required.edgeql new file mode 100644 index 00000000..1abedc7a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/enum/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/enum/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..b927ba3c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/enum/positional.required.edgeql.ex.assert @@ -0,0 +1,77 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/enum/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Enum.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/enum/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/enum/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::EnumType extending enum + ``` + """ + @type v4__codegen__enum_type() :: :A | :B | :C + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__enum_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__enum_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__enum_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__enum_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + case entity do + "A" -> :A + "B" -> :B + "C" -> :C + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql new file mode 100644 index 00000000..dbb00c8b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range('2022-07-01', '2022-12-01')]) diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..e6a985fb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Multi.Literal do + @query """ + select >multirange([range('2022-07-01', '2022-12-01')]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Date.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Date.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql new file mode 100644 index 00000000..a5dc8e8f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..c9cf7dce --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(Date.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(Date.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Date.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Date.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql new file mode 100644 index 00000000..776d0ac6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..108a6fa8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(Date.t())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(Date.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Date.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Date.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql new file mode 100644 index 00000000..affc58f2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..a7137610 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Date.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Date.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Date.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Date.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql new file mode 100644 index 00000000..af9446ef --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..b06d7dfc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Date.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Date.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Date.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Date.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql new file mode 100644 index 00000000..a379f035 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql @@ -0,0 +1 @@ +select >range('2022-07-01', '2022-12-01') diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..4f91c407 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Single.Literal do + @query """ + select >range('2022-07-01', '2022-12-01') + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Date.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Date.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql new file mode 100644 index 00000000..dc9d95bc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..a878c59d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(Date.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(Date.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Date.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Date.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql new file mode 100644 index 00000000..4b8aeb0c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..82c3fda6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(Date.t())}] + @type map_args() :: %{arg: EdgeDB.Range.t(Date.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Date.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Date.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql new file mode 100644 index 00000000..4551456c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..a1cbcf71 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Date.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Date.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Date.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Date.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql new file mode 100644 index 00000000..9723a6a2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..de57f99e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDate.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_date/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Date.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Date.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Date.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Date.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql new file mode 100644 index 00000000..e78ab2c3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range('2022-07-01T00:00:00', '2022-12-01T00:00:00')]) diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..9ea3ad5a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Multi.Literal do + @query """ + select >multirange([range('2022-07-01T00:00:00', '2022-12-01T00:00:00')]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(NaiveDateTime.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(NaiveDateTime.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql new file mode 100644 index 00000000..b00ce834 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..358b0134 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql new file mode 100644 index 00000000..d9093af0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..d83bdd5c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(NaiveDateTime.t())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(NaiveDateTime.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(NaiveDateTime.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(NaiveDateTime.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql new file mode 100644 index 00000000..d48398d9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..34488cd3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(NaiveDateTime.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql new file mode 100644 index 00000000..8d0c4613 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..0ffa2a05 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(NaiveDateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(NaiveDateTime.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(NaiveDateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(NaiveDateTime.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql new file mode 100644 index 00000000..aadd77b6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql @@ -0,0 +1 @@ +select >range('2022-07-01T00:00:00', '2022-12-01T00:00:00') diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..c71c5f2d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Single.Literal do + @query """ + select >range('2022-07-01T00:00:00', '2022-12-01T00:00:00') + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(NaiveDateTime.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(NaiveDateTime.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql new file mode 100644 index 00000000..419fd517 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..648a7722 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(NaiveDateTime.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(NaiveDateTime.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(NaiveDateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(NaiveDateTime.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql new file mode 100644 index 00000000..eefa9674 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..7c5aacc2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(NaiveDateTime.t())}] + @type map_args() :: %{arg: EdgeDB.Range.t(NaiveDateTime.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(NaiveDateTime.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(NaiveDateTime.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql new file mode 100644 index 00000000..0e99ce0d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..f86bd1ff --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(NaiveDateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(NaiveDateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(NaiveDateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(NaiveDateTime.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql new file mode 100644 index 00000000..8350e2ff --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..5466d3b4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Cal.LocalDatetime.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/cal/local_datetime/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(NaiveDateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(NaiveDateTime.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(NaiveDateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(NaiveDateTime.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql new file mode 100644 index 00000000..64a24cd9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range('2022-07-01T00:00:00', '2022-12-01T00:00:00')]) diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..9a68cca3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Multi.Literal do + @query """ + select >multirange([range('2022-07-01T00:00:00', '2022-12-01T00:00:00')]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(DateTime.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(DateTime.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql new file mode 100644 index 00000000..4ca17b5e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..e3a688ed --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(DateTime.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(DateTime.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(DateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(DateTime.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql new file mode 100644 index 00000000..2580448c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..cf4e31f3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(DateTime.t())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(DateTime.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(DateTime.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(DateTime.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql new file mode 100644 index 00000000..14f841da --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..8e403d78 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(DateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(DateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(DateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(DateTime.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql new file mode 100644 index 00000000..78aa262c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..7a46f0df --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(DateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(DateTime.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(DateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(DateTime.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql new file mode 100644 index 00000000..1236016f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql @@ -0,0 +1 @@ +select >range('2022-07-01T00:00:00', '2022-12-01T00:00:00') diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..346f270e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Single.Literal do + @query """ + select >range('2022-07-01T00:00:00', '2022-12-01T00:00:00') + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(DateTime.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(DateTime.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql new file mode 100644 index 00000000..8ccbca5e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..5b0248eb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(DateTime.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(DateTime.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(DateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(DateTime.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql new file mode 100644 index 00000000..599937a8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..6db4cd70 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(DateTime.t())}] + @type map_args() :: %{arg: EdgeDB.Range.t(DateTime.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(DateTime.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(DateTime.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql new file mode 100644 index 00000000..6ccf5a17 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..3c54cd13 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(DateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(DateTime.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(DateTime.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(DateTime.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql new file mode 100644 index 00000000..e354eb8f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..dd3e98a5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Datetime.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/datetime/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(DateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(DateTime.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(DateTime.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(DateTime.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql new file mode 100644 index 00000000..646fd934 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range(1, 10)]) diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..71bd9a0c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Multi.Literal do + @query """ + select >multirange([range(1, 10)]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Decimal.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Decimal.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql new file mode 100644 index 00000000..383e9e20 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..abea8a21 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(Decimal.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(Decimal.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Decimal.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Decimal.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql new file mode 100644 index 00000000..f005aa1d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..34b4be2d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(Decimal.t())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(Decimal.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Decimal.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Decimal.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql new file mode 100644 index 00000000..d11735e0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..86212bdd --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Decimal.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Decimal.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Decimal.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Decimal.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql new file mode 100644 index 00000000..dc8ddb92 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..bdc5d2b1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Decimal.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(Decimal.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(Decimal.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(Decimal.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql new file mode 100644 index 00000000..d566c923 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql @@ -0,0 +1 @@ +select >range(1, 10) diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..a5ea1f99 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Single.Literal do + @query """ + select >range(1, 10) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Decimal.t())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Decimal.t()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql new file mode 100644 index 00000000..0077250a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..977a9228 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(Decimal.t()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(Decimal.t()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Decimal.t()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Decimal.t()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql new file mode 100644 index 00000000..2b62f22f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..3847540a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(Decimal.t())}] + @type map_args() :: %{arg: EdgeDB.Range.t(Decimal.t())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Decimal.t())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Decimal.t()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql new file mode 100644 index 00000000..bac3f8b6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..06838dc3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Decimal.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Decimal.t()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Decimal.t()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Decimal.t()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql new file mode 100644 index 00000000..54e70d0a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..94a04d1f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Decimal.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/decimal/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Decimal.t()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(Decimal.t())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(Decimal.t()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(Decimal.t()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql new file mode 100644 index 00000000..a6377c87 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range(1, 10)]) diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..f0e999a8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Multi.Literal do + @query """ + select >multirange([range(1, 10)]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql new file mode 100644 index 00000000..8f8d047d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..c79b2786 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(float()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(float()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql new file mode 100644 index 00000000..c306dfc9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..ec9917ec --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(float())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(float())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql new file mode 100644 index 00000000..b387c218 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..1bda4ce1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql new file mode 100644 index 00000000..0aff1642 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..de2a3d7a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql new file mode 100644 index 00000000..56d5daa2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql @@ -0,0 +1 @@ +select >range(1, 10) diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..5ba4cbda --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Single.Literal do + @query """ + select >range(1, 10) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql new file mode 100644 index 00000000..0dea457d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..050951d2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(float()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(float()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql new file mode 100644 index 00000000..c68565c6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..7afbad56 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(float())}] + @type map_args() :: %{arg: EdgeDB.Range.t(float())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql new file mode 100644 index 00000000..e3e78a45 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..d2bcf9da --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql new file mode 100644 index 00000000..aaa8f324 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..b0e11a68 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float32.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float32/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql new file mode 100644 index 00000000..62d16892 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range(1, 10)]) diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..06725f81 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Multi.Literal do + @query """ + select >multirange([range(1, 10)]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql new file mode 100644 index 00000000..3539fa1b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..eceb8ef8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(float()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(float()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql new file mode 100644 index 00000000..8f27869d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..bd9060bf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(float())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(float())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql new file mode 100644 index 00000000..146c3c60 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..451756e4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql new file mode 100644 index 00000000..5351272b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..12efb6ec --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(float())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(float()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql new file mode 100644 index 00000000..0d5c7598 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql @@ -0,0 +1 @@ +select >range(1, 10) diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..c0885317 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Single.Literal do + @query """ + select >range(1, 10) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql new file mode 100644 index 00000000..4483fb44 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..3fb99016 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(float()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(float()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql new file mode 100644 index 00000000..dcb2b8d2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..61025cee --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(float())}] + @type map_args() :: %{arg: EdgeDB.Range.t(float())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql new file mode 100644 index 00000000..9a6d58d3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..fc3e1803 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql new file mode 100644 index 00000000..2ed00a2c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..604675a1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Float64.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/float64/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(float())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(float()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(float()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql new file mode 100644 index 00000000..44b03773 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range(1, 10)]) diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..9115dfda --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Multi.Literal do + @query """ + select >multirange([range(1, 10)]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql new file mode 100644 index 00000000..04b95ec6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..0026e075 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(integer()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(integer()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql new file mode 100644 index 00000000..ca5d0048 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..8add4d14 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(integer())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(integer())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql new file mode 100644 index 00000000..0a863436 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..169b7ac6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql new file mode 100644 index 00000000..0d587f35 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..7bb00551 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql new file mode 100644 index 00000000..7c624cdb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql @@ -0,0 +1 @@ +select >range(1, 10) diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..42c19fcc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Single.Literal do + @query """ + select >range(1, 10) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql new file mode 100644 index 00000000..dfe1dc18 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..33526998 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(integer()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(integer()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql new file mode 100644 index 00000000..612749a0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..7e2f38fe --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(integer())}] + @type map_args() :: %{arg: EdgeDB.Range.t(integer())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql new file mode 100644 index 00000000..06f30ed2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..a05551ae --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql new file mode 100644 index 00000000..bd34d303 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..895111d5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int32.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int32/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql b/test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql new file mode 100644 index 00000000..00fc9dcc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql @@ -0,0 +1 @@ +select >multirange([range(1, 10)]) diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql.ex.assert new file mode 100644 index 00000000..21ebd9bd --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Multi.Literal do + @query """ + select >multirange([range(1, 10)]) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/multi/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql new file mode 100644 index 00000000..65cbc176 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..72249e47 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Multi.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/multi/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(integer()) | nil}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(integer()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql new file mode 100644 index 00000000..f890235c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql.ex.assert new file mode 100644 index 00000000..618de19b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Multi.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/multi/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.MultiRange.t(integer())}] + @type map_args() :: %{arg: EdgeDB.MultiRange.t(integer())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql new file mode 100644 index 00000000..9d0b1d0d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..290f6c62 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Multi.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/multi/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql new file mode 100644 index 00000000..d62bef89 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..84106661 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Multi.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/multi/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.MultiRange.t(integer())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.MultiRange.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.MultiRange.t(integer()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql b/test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql new file mode 100644 index 00000000..b1c8281d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql @@ -0,0 +1 @@ +select >range(1, 10) diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql.ex.assert new file mode 100644 index 00000000..3fe39204 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Single.Literal do + @query """ + select >range(1, 10) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/single/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer())} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql new file mode 100644 index 00000000..fa205047 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..2edf5a49 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Single.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/single/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(integer()) | nil}] + @type map_args() :: %{arg: EdgeDB.Range.t(integer()) | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql b/test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql new file mode 100644 index 00000000..faf17cb1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql.ex.assert new file mode 100644 index 00000000..afaa0254 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Single.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/single/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.Range.t(integer())}] + @type map_args() :: %{arg: EdgeDB.Range.t(integer())} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer())} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql new file mode 100644 index 00000000..92817ea0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..b76a1ccb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Single.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/single/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer()) | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()) | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql b/test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql new file mode 100644 index 00000000..5b4db1d4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..1295a277 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Range.Int64.Single.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/range/int64/single/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.Range.t(integer())} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.Range.t(integer()), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.Range.t(integer()) + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql new file mode 100644 index 00000000..3fa1f2a0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..3ea347f9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Custom.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BigintType extending std::bigint + ``` + """ + @type v4__codegen__bigint_type() :: Decimal.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bigint_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bigint_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql new file mode 100644 index 00000000..ad225d82 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..20e562fe --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BigintType extending std::bigint + ``` + """ + @type v4__codegen__bigint_type() :: Decimal.t() + + @type keyword_args() :: [{:arg, v4__codegen__bigint_type() | nil}] + @type map_args() :: %{arg: v4__codegen__bigint_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bigint_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bigint_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql new file mode 100644 index 00000000..be1c04f3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..6636ee93 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BigintType extending std::bigint + ``` + """ + @type v4__codegen__bigint_type() :: Decimal.t() + + @type keyword_args() :: [{:arg, v4__codegen__bigint_type()}] + @type map_args() :: %{arg: v4__codegen__bigint_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bigint_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bigint_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql new file mode 100644 index 00000000..53725b22 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..a9a4abd3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BigintType extending std::bigint + ``` + """ + @type v4__codegen__bigint_type() :: Decimal.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bigint_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bigint_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bigint_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bigint_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql new file mode 100644 index 00000000..d1693545 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..920678f0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BigintType extending std::bigint + ``` + """ + @type v4__codegen__bigint_type() :: Decimal.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bigint_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bigint_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bigint_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bigint_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql new file mode 100644 index 00000000..df9f738e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..e8d5c0b1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Std.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql new file mode 100644 index 00000000..e5b56d31 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..ed113b45 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, Decimal.t() | nil}] + @type map_args() :: %{arg: Decimal.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql new file mode 100644 index 00000000..1a217f33 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..140f5173 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, Decimal.t()}] + @type map_args() :: %{arg: Decimal.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql new file mode 100644 index 00000000..bffb2a61 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..7ddc612b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Decimal.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Decimal.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql new file mode 100644 index 00000000..81df9ee6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..cac9d555 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bigint.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bigint/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Decimal.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Decimal.t(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql new file mode 100644 index 00000000..78635c02 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql @@ -0,0 +1 @@ +select true diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..e8eaaac9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Custom.Literal do + @query """ + select true + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BoolType extending std::bool + ``` + """ + @type v4__codegen__bool_type() :: boolean() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bool_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bool_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql new file mode 100644 index 00000000..4d10a3ec --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..738fada3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BoolType extending std::bool + ``` + """ + @type v4__codegen__bool_type() :: boolean() + + @type keyword_args() :: [{:arg, v4__codegen__bool_type() | nil}] + @type map_args() :: %{arg: v4__codegen__bool_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bool_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bool_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql new file mode 100644 index 00000000..5b3915ab --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..47607db8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BoolType extending std::bool + ``` + """ + @type v4__codegen__bool_type() :: boolean() + + @type keyword_args() :: [{:arg, v4__codegen__bool_type()}] + @type map_args() :: %{arg: v4__codegen__bool_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bool_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bool_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql new file mode 100644 index 00000000..dda35ff1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..653f71fa --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BoolType extending std::bool + ``` + """ + @type v4__codegen__bool_type() :: boolean() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bool_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bool_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bool_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bool_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql new file mode 100644 index 00000000..1ba2f226 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..79e94c6b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BoolType extending std::bool + ``` + """ + @type v4__codegen__bool_type() :: boolean() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bool_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bool_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bool_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bool_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql new file mode 100644 index 00000000..d4d41b7d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql @@ -0,0 +1 @@ +select true diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..9878104f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Std.Literal do + @query """ + select true + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, boolean()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: boolean() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql new file mode 100644 index 00000000..f8413cff --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..33713772 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, boolean() | nil}] + @type map_args() :: %{arg: boolean() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, boolean() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: boolean() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql new file mode 100644 index 00000000..32a14db6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..16befe75 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, boolean()}] + @type map_args() :: %{arg: boolean()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, boolean()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: boolean() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql new file mode 100644 index 00000000..53367eb1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..ce751318 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: boolean() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, boolean() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: boolean() | nil, + opts :: list(EdgeDB.query_option()) + ) :: boolean() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql new file mode 100644 index 00000000..ed4660dd --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..bfa81c04 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bool.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bool/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: boolean(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, boolean()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: boolean(), + opts :: list(EdgeDB.query_option()) + ) :: boolean() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql new file mode 100644 index 00000000..ee5dc63d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql @@ -0,0 +1 @@ +select b"hello world" diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..776d53f7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Custom.Literal do + @query """ + select b"hello world" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BytesType extending std::bytes + ``` + """ + @type v4__codegen__bytes_type() :: bitstring() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bytes_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bytes_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql new file mode 100644 index 00000000..cc07dd5b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..e3f6453e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BytesType extending std::bytes + ``` + """ + @type v4__codegen__bytes_type() :: bitstring() + + @type keyword_args() :: [{:arg, v4__codegen__bytes_type() | nil}] + @type map_args() :: %{arg: v4__codegen__bytes_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bytes_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bytes_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql new file mode 100644 index 00000000..6229a4d7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..ec5c646c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BytesType extending std::bytes + ``` + """ + @type v4__codegen__bytes_type() :: bitstring() + + @type keyword_args() :: [{:arg, v4__codegen__bytes_type()}] + @type map_args() :: %{arg: v4__codegen__bytes_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bytes_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bytes_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql new file mode 100644 index 00000000..e131dd02 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..4680adf9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BytesType extending std::bytes + ``` + """ + @type v4__codegen__bytes_type() :: bitstring() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bytes_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bytes_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bytes_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bytes_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql new file mode 100644 index 00000000..553e7967 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..e8904a2d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::BytesType extending std::bytes + ``` + """ + @type v4__codegen__bytes_type() :: bitstring() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bytes_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__bytes_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__bytes_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__bytes_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql new file mode 100644 index 00000000..394967b6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql @@ -0,0 +1 @@ +select b"hello world" diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..5117601b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Std.Literal do + @query """ + select b"hello world" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, bitstring()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: bitstring() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql new file mode 100644 index 00000000..6b35f318 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..71816b2b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, bitstring() | nil}] + @type map_args() :: %{arg: bitstring() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, bitstring() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: bitstring() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql new file mode 100644 index 00000000..46621488 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..e0149b13 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, bitstring()}] + @type map_args() :: %{arg: bitstring()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, bitstring()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: bitstring() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql new file mode 100644 index 00000000..d85522ac --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..bf1fc130 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: bitstring() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, bitstring() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: bitstring() | nil, + opts :: list(EdgeDB.query_option()) + ) :: bitstring() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql new file mode 100644 index 00000000..a32f7905 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..9186d926 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Bytes.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/bytes/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: bitstring(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, bitstring()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: bitstring(), + opts :: list(EdgeDB.query_option()) + ) :: bitstring() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql new file mode 100644 index 00000000..341b2f1d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql @@ -0,0 +1 @@ +select "45 days" diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..e47ab8c7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Custom.Literal do + @query """ + select "45 days" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalDateDurationType extending cal::date_duration + ``` + """ + @type v4__codegen__cal_date_duration_type() :: EdgeDB.DateDuration.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_date_duration_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_date_duration_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql new file mode 100644 index 00000000..703637cf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..7ec926fc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalDateDurationType extending cal::date_duration + ``` + """ + @type v4__codegen__cal_date_duration_type() :: EdgeDB.DateDuration.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_date_duration_type() | nil}] + @type map_args() :: %{arg: v4__codegen__cal_date_duration_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_date_duration_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_date_duration_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql new file mode 100644 index 00000000..71980b81 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..38dae4a3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalDateDurationType extending cal::date_duration + ``` + """ + @type v4__codegen__cal_date_duration_type() :: EdgeDB.DateDuration.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_date_duration_type()}] + @type map_args() :: %{arg: v4__codegen__cal_date_duration_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_date_duration_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_date_duration_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql new file mode 100644 index 00000000..65dcdb44 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..260df1e3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalDateDurationType extending cal::date_duration + ``` + """ + @type v4__codegen__cal_date_duration_type() :: EdgeDB.DateDuration.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_date_duration_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_date_duration_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_date_duration_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_date_duration_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql new file mode 100644 index 00000000..ff82af5a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..086dfe9d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalDateDurationType extending cal::date_duration + ``` + """ + @type v4__codegen__cal_date_duration_type() :: EdgeDB.DateDuration.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_date_duration_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_date_duration_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_date_duration_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_date_duration_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql new file mode 100644 index 00000000..7720a0b3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql @@ -0,0 +1 @@ +select "45 days" diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..84f34518 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Std.Literal do + @query """ + select "45 days" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.DateDuration.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.DateDuration.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql new file mode 100644 index 00000000..772a64cc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..3f3e725a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.DateDuration.t() | nil}] + @type map_args() :: %{arg: EdgeDB.DateDuration.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.DateDuration.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.DateDuration.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql new file mode 100644 index 00000000..269d9ebb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..63504283 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.DateDuration.t()}] + @type map_args() :: %{arg: EdgeDB.DateDuration.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.DateDuration.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.DateDuration.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql new file mode 100644 index 00000000..b2b693cb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..8343e3e8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.DateDuration.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.DateDuration.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.DateDuration.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.DateDuration.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql new file mode 100644 index 00000000..1d68255d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..a177640c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.DateDuration.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/date_duration/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.DateDuration.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.DateDuration.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.DateDuration.t(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.DateDuration.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql new file mode 100644 index 00000000..abbf6c15 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql @@ -0,0 +1 @@ +select '2000-02-16' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..05f24c7e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Custom.Literal do + @query """ + select '2000-02-16' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDateType extending cal::local_date + ``` + """ + @type v4__codegen__cal_local_date_type() :: Date.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_date_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_date_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql new file mode 100644 index 00000000..ff609b2b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..5002e61e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDateType extending cal::local_date + ``` + """ + @type v4__codegen__cal_local_date_type() :: Date.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_local_date_type() | nil}] + @type map_args() :: %{arg: v4__codegen__cal_local_date_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_date_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_date_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql new file mode 100644 index 00000000..99dd3806 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..331a2c2b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDateType extending cal::local_date + ``` + """ + @type v4__codegen__cal_local_date_type() :: Date.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_local_date_type()}] + @type map_args() :: %{arg: v4__codegen__cal_local_date_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_date_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_date_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql new file mode 100644 index 00000000..9882ed14 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..7fb7ebcf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDateType extending cal::local_date + ``` + """ + @type v4__codegen__cal_local_date_type() :: Date.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_date_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_date_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_date_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_date_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql new file mode 100644 index 00000000..19a78f5b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..4a9c402b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDateType extending cal::local_date + ``` + """ + @type v4__codegen__cal_local_date_type() :: Date.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_date_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_date_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_date_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_date_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql new file mode 100644 index 00000000..a288bc51 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql @@ -0,0 +1 @@ +select '2000-02-16' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..992a3b17 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Std.Literal do + @query """ + select '2000-02-16' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Date.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: Date.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql new file mode 100644 index 00000000..5939bbe3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..47f533d0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, Date.t() | nil}] + @type map_args() :: %{arg: Date.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Date.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Date.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql new file mode 100644 index 00000000..3d153427 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..3a3bd0f4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, Date.t()}] + @type map_args() :: %{arg: Date.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Date.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Date.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql new file mode 100644 index 00000000..d794d2b9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..b0d11e99 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Date.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Date.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Date.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: Date.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql new file mode 100644 index 00000000..594b719f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..4ba60208 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDate.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_date/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Date.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Date.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Date.t(), + opts :: list(EdgeDB.query_option()) + ) :: Date.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql new file mode 100644 index 00000000..07b41f9d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql @@ -0,0 +1 @@ +select '2000-02-16T16:13:02' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..ba914f02 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Custom.Literal do + @query """ + select '2000-02-16T16:13:02' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDatetimeType extending cal::local_datetime + ``` + """ + @type v4__codegen__cal_local_datetime_type() :: NaiveDateTime.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_datetime_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_datetime_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql new file mode 100644 index 00000000..62e99adf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..80f8a778 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDatetimeType extending cal::local_datetime + ``` + """ + @type v4__codegen__cal_local_datetime_type() :: NaiveDateTime.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_local_datetime_type() | nil}] + @type map_args() :: %{arg: v4__codegen__cal_local_datetime_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_datetime_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_datetime_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql new file mode 100644 index 00000000..08ce64e3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..b38d4f39 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDatetimeType extending cal::local_datetime + ``` + """ + @type v4__codegen__cal_local_datetime_type() :: NaiveDateTime.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_local_datetime_type()}] + @type map_args() :: %{arg: v4__codegen__cal_local_datetime_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_datetime_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_datetime_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql new file mode 100644 index 00000000..a374c36b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..86fb4347 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDatetimeType extending cal::local_datetime + ``` + """ + @type v4__codegen__cal_local_datetime_type() :: NaiveDateTime.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_datetime_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_datetime_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_datetime_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_datetime_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql new file mode 100644 index 00000000..26093d76 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..ea732485 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalDatetimeType extending cal::local_datetime + ``` + """ + @type v4__codegen__cal_local_datetime_type() :: NaiveDateTime.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_datetime_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_datetime_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_datetime_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_datetime_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql new file mode 100644 index 00000000..71451152 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql @@ -0,0 +1 @@ +select '2000-02-16T16:13:02' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..be43fea9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Std.Literal do + @query """ + select '2000-02-16T16:13:02' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, NaiveDateTime.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: NaiveDateTime.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql new file mode 100644 index 00000000..e2d42152 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..ff544140 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, NaiveDateTime.t() | nil}] + @type map_args() :: %{arg: NaiveDateTime.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, NaiveDateTime.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: NaiveDateTime.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql new file mode 100644 index 00000000..fe62328b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..645e9134 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, NaiveDateTime.t()}] + @type map_args() :: %{arg: NaiveDateTime.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, NaiveDateTime.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: NaiveDateTime.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql new file mode 100644 index 00000000..c04c8d25 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..2267710a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: NaiveDateTime.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, NaiveDateTime.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: NaiveDateTime.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: NaiveDateTime.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql new file mode 100644 index 00000000..45dd112a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..01f7ca56 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalDatetime.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_datetime/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: NaiveDateTime.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, NaiveDateTime.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: NaiveDateTime.t(), + opts :: list(EdgeDB.query_option()) + ) :: NaiveDateTime.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql new file mode 100644 index 00000000..cd687517 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql @@ -0,0 +1 @@ +select '16:13:02' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..db8f45a6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Custom.Literal do + @query """ + select '16:13:02' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalTimeType extending cal::local_time + ``` + """ + @type v4__codegen__cal_local_time_type() :: Time.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_time_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_time_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql new file mode 100644 index 00000000..ce940e13 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..8c0ee025 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalTimeType extending cal::local_time + ``` + """ + @type v4__codegen__cal_local_time_type() :: Time.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_local_time_type() | nil}] + @type map_args() :: %{arg: v4__codegen__cal_local_time_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_time_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_time_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql new file mode 100644 index 00000000..3ef9b9c3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..0d830242 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalTimeType extending cal::local_time + ``` + """ + @type v4__codegen__cal_local_time_type() :: Time.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_local_time_type()}] + @type map_args() :: %{arg: v4__codegen__cal_local_time_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_time_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_time_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql new file mode 100644 index 00000000..efb35ded --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..3df75911 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalTimeType extending cal::local_time + ``` + """ + @type v4__codegen__cal_local_time_type() :: Time.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_time_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_time_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_time_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_time_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql new file mode 100644 index 00000000..a5c401df --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..7e648eb4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalLocalTimeType extending cal::local_time + ``` + """ + @type v4__codegen__cal_local_time_type() :: Time.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_time_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_local_time_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_local_time_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_local_time_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql new file mode 100644 index 00000000..6709c002 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql @@ -0,0 +1 @@ +select '16:13:02' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..67e9b11a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Std.Literal do + @query """ + select '16:13:02' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Time.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: Time.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql new file mode 100644 index 00000000..92733cac --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..330936d7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, Time.t() | nil}] + @type map_args() :: %{arg: Time.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Time.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Time.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql new file mode 100644 index 00000000..b186a71a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..cf03ee0b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, Time.t()}] + @type map_args() :: %{arg: Time.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Time.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Time.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql new file mode 100644 index 00000000..248155ba --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..2a85a9ac --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Time.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Time.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Time.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: Time.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql new file mode 100644 index 00000000..e6bdb2cc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..bcd6db61 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.LocalTime.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/local_time/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Time.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Time.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Time.t(), + opts :: list(EdgeDB.query_option()) + ) :: Time.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql new file mode 100644 index 00000000..384c265d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql @@ -0,0 +1 @@ +select '1 year' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..42993d37 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Custom.Literal do + @query """ + select '1 year' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalRelativeDurationType extending cal::relative_duration + ``` + """ + @type v4__codegen__cal_relative_duration_type() :: EdgeDB.RelativeDuration.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_relative_duration_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_relative_duration_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql new file mode 100644 index 00000000..6f2be84e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..ff348dea --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalRelativeDurationType extending cal::relative_duration + ``` + """ + @type v4__codegen__cal_relative_duration_type() :: EdgeDB.RelativeDuration.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_relative_duration_type() | nil}] + @type map_args() :: %{arg: v4__codegen__cal_relative_duration_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_relative_duration_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_relative_duration_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql new file mode 100644 index 00000000..1a6a9702 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..16637316 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalRelativeDurationType extending cal::relative_duration + ``` + """ + @type v4__codegen__cal_relative_duration_type() :: EdgeDB.RelativeDuration.t() + + @type keyword_args() :: [{:arg, v4__codegen__cal_relative_duration_type()}] + @type map_args() :: %{arg: v4__codegen__cal_relative_duration_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_relative_duration_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_relative_duration_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql new file mode 100644 index 00000000..4dcdcf84 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..e3062800 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalRelativeDurationType extending cal::relative_duration + ``` + """ + @type v4__codegen__cal_relative_duration_type() :: EdgeDB.RelativeDuration.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_relative_duration_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_relative_duration_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_relative_duration_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_relative_duration_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql new file mode 100644 index 00000000..223f0901 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..6b0c19e2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CalRelativeDurationType extending cal::relative_duration + ``` + """ + @type v4__codegen__cal_relative_duration_type() :: EdgeDB.RelativeDuration.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_relative_duration_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cal_relative_duration_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cal_relative_duration_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cal_relative_duration_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql new file mode 100644 index 00000000..0c90da85 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql @@ -0,0 +1 @@ +select '1 year' diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..fce0babb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Std.Literal do + @query """ + select '1 year' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.RelativeDuration.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.RelativeDuration.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql new file mode 100644 index 00000000..11dbd67d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..6987c65c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.RelativeDuration.t() | nil}] + @type map_args() :: %{arg: EdgeDB.RelativeDuration.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.RelativeDuration.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.RelativeDuration.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql new file mode 100644 index 00000000..179fcfc4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..543db115 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.RelativeDuration.t()}] + @type map_args() :: %{arg: EdgeDB.RelativeDuration.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.RelativeDuration.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.RelativeDuration.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql new file mode 100644 index 00000000..65fb6f24 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..c590c9fd --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.RelativeDuration.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.RelativeDuration.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.RelativeDuration.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.RelativeDuration.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql new file mode 100644 index 00000000..77cb0cb0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..19a60f82 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cal.RelativeDuration.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cal/relative_duration/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.RelativeDuration.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.RelativeDuration.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.RelativeDuration.t(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.RelativeDuration.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql new file mode 100644 index 00000000..bbe7c43b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql @@ -0,0 +1 @@ +select "1B" diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..8ae34bbd --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Custom.Literal do + @query """ + select "1B" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CfgMemoryType extending cfg::memory + ``` + """ + @type v4__codegen__cfg_memory_type() :: EdgeDB.ConfigMemory.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cfg_memory_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cfg_memory_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql new file mode 100644 index 00000000..5ee0e13b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..432c09f2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CfgMemoryType extending cfg::memory + ``` + """ + @type v4__codegen__cfg_memory_type() :: EdgeDB.ConfigMemory.t() + + @type keyword_args() :: [{:arg, v4__codegen__cfg_memory_type() | nil}] + @type map_args() :: %{arg: v4__codegen__cfg_memory_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cfg_memory_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cfg_memory_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql new file mode 100644 index 00000000..f15e99b1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..7cc33315 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CfgMemoryType extending cfg::memory + ``` + """ + @type v4__codegen__cfg_memory_type() :: EdgeDB.ConfigMemory.t() + + @type keyword_args() :: [{:arg, v4__codegen__cfg_memory_type()}] + @type map_args() :: %{arg: v4__codegen__cfg_memory_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cfg_memory_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cfg_memory_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql new file mode 100644 index 00000000..6147d7cb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..f435ed1f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CfgMemoryType extending cfg::memory + ``` + """ + @type v4__codegen__cfg_memory_type() :: EdgeDB.ConfigMemory.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cfg_memory_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cfg_memory_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cfg_memory_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cfg_memory_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql new file mode 100644 index 00000000..65207f72 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..9e1aecc1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::CfgMemoryType extending cfg::memory + ``` + """ + @type v4__codegen__cfg_memory_type() :: EdgeDB.ConfigMemory.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cfg_memory_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__cfg_memory_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__cfg_memory_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__cfg_memory_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql new file mode 100644 index 00000000..edcc840d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql @@ -0,0 +1 @@ +select '1B' diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..0efeb972 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Std.Literal do + @query """ + select '1B' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.ConfigMemory.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.ConfigMemory.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql new file mode 100644 index 00000000..f3040e64 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..424841ed --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.ConfigMemory.t() | nil}] + @type map_args() :: %{arg: EdgeDB.ConfigMemory.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.ConfigMemory.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.ConfigMemory.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql new file mode 100644 index 00000000..4359bc22 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..b93a2fc0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, EdgeDB.ConfigMemory.t()}] + @type map_args() :: %{arg: EdgeDB.ConfigMemory.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.ConfigMemory.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.ConfigMemory.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql new file mode 100644 index 00000000..bccae698 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..0687a7ae --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.ConfigMemory.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.ConfigMemory.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.ConfigMemory.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.ConfigMemory.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql new file mode 100644 index 00000000..eba93bc6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..a288fa60 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Cfg.Memory.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/cfg/memory/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.ConfigMemory.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, EdgeDB.ConfigMemory.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: EdgeDB.ConfigMemory.t(), + opts :: list(EdgeDB.query_option()) + ) :: EdgeDB.ConfigMemory.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql new file mode 100644 index 00000000..bc9f6bde --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql @@ -0,0 +1 @@ +select '2000-02-16T16:13:02' diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..d4a5ef81 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Custom.Literal do + @query """ + select '2000-02-16T16:13:02' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DatetimeType extending std::datetime + ``` + """ + @type v4__codegen__datetime_type() :: DateTime.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__datetime_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__datetime_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql new file mode 100644 index 00000000..fd3b0364 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..4d6c1f12 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DatetimeType extending std::datetime + ``` + """ + @type v4__codegen__datetime_type() :: DateTime.t() + + @type keyword_args() :: [{:arg, v4__codegen__datetime_type() | nil}] + @type map_args() :: %{arg: v4__codegen__datetime_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__datetime_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__datetime_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql new file mode 100644 index 00000000..cc1f72c9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..83b00154 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DatetimeType extending std::datetime + ``` + """ + @type v4__codegen__datetime_type() :: DateTime.t() + + @type keyword_args() :: [{:arg, v4__codegen__datetime_type()}] + @type map_args() :: %{arg: v4__codegen__datetime_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__datetime_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__datetime_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql new file mode 100644 index 00000000..19f85f22 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..8205f8ce --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DatetimeType extending std::datetime + ``` + """ + @type v4__codegen__datetime_type() :: DateTime.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__datetime_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__datetime_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__datetime_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__datetime_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql new file mode 100644 index 00000000..3f1747d7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..65305bc3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DatetimeType extending std::datetime + ``` + """ + @type v4__codegen__datetime_type() :: DateTime.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__datetime_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__datetime_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__datetime_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__datetime_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql new file mode 100644 index 00000000..e2ceb64a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql @@ -0,0 +1 @@ +select '2000-02-16T16:13:02' diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..dd901d4d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Std.Literal do + @query """ + select '2000-02-16T16:13:02' + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, DateTime.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: DateTime.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql new file mode 100644 index 00000000..26f34283 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..e03e4a62 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, DateTime.t() | nil}] + @type map_args() :: %{arg: DateTime.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, DateTime.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: DateTime.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql new file mode 100644 index 00000000..14858df4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..f46ebfd0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, DateTime.t()}] + @type map_args() :: %{arg: DateTime.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, DateTime.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: DateTime.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql new file mode 100644 index 00000000..7a7446cc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..3ed6ba29 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: DateTime.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, DateTime.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: DateTime.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: DateTime.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql new file mode 100644 index 00000000..805fbad2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..7fca93b8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Datetime.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/datetime/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: DateTime.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, DateTime.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: DateTime.t(), + opts :: list(EdgeDB.query_option()) + ) :: DateTime.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql new file mode 100644 index 00000000..b5596a73 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql @@ -0,0 +1 @@ +select 16.132 diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..3514c95a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Custom.Literal do + @query """ + select 16.132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DecimalType extending std::decimal + ``` + """ + @type v4__codegen__decimal_type() :: Decimal.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__decimal_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__decimal_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql new file mode 100644 index 00000000..0d784d29 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..7d10750e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DecimalType extending std::decimal + ``` + """ + @type v4__codegen__decimal_type() :: Decimal.t() + + @type keyword_args() :: [{:arg, v4__codegen__decimal_type() | nil}] + @type map_args() :: %{arg: v4__codegen__decimal_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__decimal_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__decimal_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql new file mode 100644 index 00000000..5490f75e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..a8c8cc8a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DecimalType extending std::decimal + ``` + """ + @type v4__codegen__decimal_type() :: Decimal.t() + + @type keyword_args() :: [{:arg, v4__codegen__decimal_type()}] + @type map_args() :: %{arg: v4__codegen__decimal_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__decimal_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__decimal_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql new file mode 100644 index 00000000..f7269931 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..85569563 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DecimalType extending std::decimal + ``` + """ + @type v4__codegen__decimal_type() :: Decimal.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__decimal_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__decimal_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__decimal_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__decimal_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql new file mode 100644 index 00000000..b099cef1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..0f39e1b6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DecimalType extending std::decimal + ``` + """ + @type v4__codegen__decimal_type() :: Decimal.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__decimal_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__decimal_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__decimal_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__decimal_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql new file mode 100644 index 00000000..59194ca0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql @@ -0,0 +1 @@ +select 16.132 diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..fb8f7018 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Std.Literal do + @query """ + select 16.132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql new file mode 100644 index 00000000..8918780e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..d7cb0ecd --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, Decimal.t() | nil}] + @type map_args() :: %{arg: Decimal.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql new file mode 100644 index 00000000..660c70ff --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..6bc8fe5a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, Decimal.t()}] + @type map_args() :: %{arg: Decimal.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql new file mode 100644 index 00000000..a2263655 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..5f9a9fa8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Decimal.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Decimal.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql new file mode 100644 index 00000000..0fad4cf5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..18938b83 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Decimal.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/decimal/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: Decimal.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Decimal.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: Decimal.t(), + opts :: list(EdgeDB.query_option()) + ) :: Decimal.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql new file mode 100644 index 00000000..81c1244b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql @@ -0,0 +1 @@ +select "45.6 seconds" diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..94e2f391 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Custom.Literal do + @query """ + select "45.6 seconds" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DurationType extending std::duration + ``` + """ + @type v4__codegen__duration_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__duration_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__duration_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql new file mode 100644 index 00000000..89040f06 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..ea639140 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DurationType extending std::duration + ``` + """ + @type v4__codegen__duration_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__duration_type() | nil}] + @type map_args() :: %{arg: v4__codegen__duration_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__duration_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__duration_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql new file mode 100644 index 00000000..3d0ad6a2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..ccd1a734 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DurationType extending std::duration + ``` + """ + @type v4__codegen__duration_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__duration_type()}] + @type map_args() :: %{arg: v4__codegen__duration_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__duration_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__duration_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql new file mode 100644 index 00000000..058ab665 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..319d0ade --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DurationType extending std::duration + ``` + """ + @type v4__codegen__duration_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__duration_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__duration_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__duration_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__duration_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql new file mode 100644 index 00000000..87c3a618 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..cbdce5ae --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::DurationType extending std::duration + ``` + """ + @type v4__codegen__duration_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__duration_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__duration_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__duration_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__duration_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql new file mode 100644 index 00000000..65d9ae62 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql @@ -0,0 +1 @@ +select "45.6 seconds" diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..a9cfea43 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Std.Literal do + @query """ + select "45.6 seconds" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/std/literal.edgeql" + + @typedoc """ + ```edgeql + std::duration + ``` + """ + @type duration() :: Timex.Duration.t() | integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, duration()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: duration() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql new file mode 100644 index 00000000..828aa05d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..8180976a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/std/named.optional.edgeql" + + @typedoc """ + ```edgeql + std::duration + ``` + """ + @type duration() :: Timex.Duration.t() | integer() + + @type keyword_args() :: [{:arg, duration() | nil}] + @type map_args() :: %{arg: duration() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, duration() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: duration() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql new file mode 100644 index 00000000..775f2c26 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..a3198f67 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/std/named.required.edgeql" + + @typedoc """ + ```edgeql + std::duration + ``` + """ + @type duration() :: Timex.Duration.t() | integer() + + @type keyword_args() :: [{:arg, duration()}] + @type map_args() :: %{arg: duration()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, duration()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: duration() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql new file mode 100644 index 00000000..0405131f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..fc8cf4ed --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/std/positional.optional.edgeql" + + @typedoc """ + ```edgeql + std::duration + ``` + """ + @type duration() :: Timex.Duration.t() | integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: duration() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, duration() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: duration() | nil, + opts :: list(EdgeDB.query_option()) + ) :: duration() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql new file mode 100644 index 00000000..61bc21ea --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..d185bbc6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Duration.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/duration/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: String.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, String.t()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: String.t(), + opts :: list(EdgeDB.query_option()) + ) :: String.t() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql new file mode 100644 index 00000000..9631a660 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql @@ -0,0 +1 @@ +select 16.132 diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..c830f2e8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Custom.Literal do + @query """ + select 16.132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float32Type extending std::float32 + ``` + """ + @type v4__codegen__float32_type() :: float() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float32_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float32_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql new file mode 100644 index 00000000..ccf6a498 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..70e0b752 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float32Type extending std::float32 + ``` + """ + @type v4__codegen__float32_type() :: float() + + @type keyword_args() :: [{:arg, v4__codegen__float32_type() | nil}] + @type map_args() :: %{arg: v4__codegen__float32_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float32_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float32_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql new file mode 100644 index 00000000..94eb285b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..c2d02a65 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float32Type extending std::float32 + ``` + """ + @type v4__codegen__float32_type() :: float() + + @type keyword_args() :: [{:arg, v4__codegen__float32_type()}] + @type map_args() :: %{arg: v4__codegen__float32_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float32_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float32_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql new file mode 100644 index 00000000..4757bc5a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..93cbcdbb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float32Type extending std::float32 + ``` + """ + @type v4__codegen__float32_type() :: float() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float32_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float32_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float32_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float32_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql new file mode 100644 index 00000000..7b47903e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..9e9151f2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float32Type extending std::float32 + ``` + """ + @type v4__codegen__float32_type() :: float() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float32_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float32_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float32_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float32_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql new file mode 100644 index 00000000..ac5d6c94 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql @@ -0,0 +1 @@ +select 16.132 diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..86d4f0e9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Std.Literal do + @query """ + select 16.132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: float() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql new file mode 100644 index 00000000..f47410f6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..fd6a2bb6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, float() | nil}] + @type map_args() :: %{arg: float() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: float() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql new file mode 100644 index 00000000..fb72b8e7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..fcf6187e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, float()}] + @type map_args() :: %{arg: float()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: float() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql new file mode 100644 index 00000000..63989eeb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..088d38cc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: float() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: float() | nil, + opts :: list(EdgeDB.query_option()) + ) :: float() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql new file mode 100644 index 00000000..f6610ec0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..d1e8d054 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float32.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float32/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: float(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: float(), + opts :: list(EdgeDB.query_option()) + ) :: float() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql new file mode 100644 index 00000000..fea56698 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql @@ -0,0 +1 @@ +select 16.132 diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..49dea0e9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Custom.Literal do + @query """ + select 16.132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float64Type extending std::float64 + ``` + """ + @type v4__codegen__float64_type() :: float() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float64_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float64_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql new file mode 100644 index 00000000..17ebf471 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..e7f92340 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float64Type extending std::float64 + ``` + """ + @type v4__codegen__float64_type() :: float() + + @type keyword_args() :: [{:arg, v4__codegen__float64_type() | nil}] + @type map_args() :: %{arg: v4__codegen__float64_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float64_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float64_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql new file mode 100644 index 00000000..0b486d0f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..a9466678 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float64Type extending std::float64 + ``` + """ + @type v4__codegen__float64_type() :: float() + + @type keyword_args() :: [{:arg, v4__codegen__float64_type()}] + @type map_args() :: %{arg: v4__codegen__float64_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float64_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float64_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql new file mode 100644 index 00000000..823caaaf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..edb3f4c8 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float64Type extending std::float64 + ``` + """ + @type v4__codegen__float64_type() :: float() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float64_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float64_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float64_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float64_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql new file mode 100644 index 00000000..c991146b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..ff433e75 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Float64Type extending std::float64 + ``` + """ + @type v4__codegen__float64_type() :: float() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float64_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__float64_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__float64_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__float64_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql new file mode 100644 index 00000000..f0a34d93 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql @@ -0,0 +1 @@ +select 16.132 diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..c725a1e9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Std.Literal do + @query """ + select 16.132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: float() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql new file mode 100644 index 00000000..130dfb14 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..3d1c4205 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, float() | nil}] + @type map_args() :: %{arg: float() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: float() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql new file mode 100644 index 00000000..2d9f2ae1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..f6cd7cf0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, float()}] + @type map_args() :: %{arg: float()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: float() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql new file mode 100644 index 00000000..71829f02 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..33c45edc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: float() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: float() | nil, + opts :: list(EdgeDB.query_option()) + ) :: float() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql new file mode 100644 index 00000000..df83e92f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..ece65025 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Float64.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/float64/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: float(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, float()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: float(), + opts :: list(EdgeDB.query_option()) + ) :: float() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql new file mode 100644 index 00000000..878ac318 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..926ce4b1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Custom.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int16Type extending std::int16 + ``` + """ + @type v4__codegen__int16_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int16_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int16_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql new file mode 100644 index 00000000..42abb656 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..ab66eee6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int16Type extending std::int16 + ``` + """ + @type v4__codegen__int16_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__int16_type() | nil}] + @type map_args() :: %{arg: v4__codegen__int16_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int16_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int16_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql new file mode 100644 index 00000000..371ba91c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..1f99487d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int16Type extending std::int16 + ``` + """ + @type v4__codegen__int16_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__int16_type()}] + @type map_args() :: %{arg: v4__codegen__int16_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int16_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int16_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql new file mode 100644 index 00000000..765cf73d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..fc08fcbe --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int16Type extending std::int16 + ``` + """ + @type v4__codegen__int16_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int16_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int16_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int16_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int16_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql new file mode 100644 index 00000000..b5c8300a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..a3af0bb0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int16Type extending std::int16 + ``` + """ + @type v4__codegen__int16_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int16_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int16_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int16_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int16_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql new file mode 100644 index 00000000..be392678 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..bde039ce --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Std.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql new file mode 100644 index 00000000..c13aeecf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..a70c3f86 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, integer() | nil}] + @type map_args() :: %{arg: integer() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: integer() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql new file mode 100644 index 00000000..98ad1219 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..55c73173 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, integer()}] + @type map_args() :: %{arg: integer()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql new file mode 100644 index 00000000..47a938b4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..67b21fad --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: integer() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: integer() | nil, + opts :: list(EdgeDB.query_option()) + ) :: integer() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql new file mode 100644 index 00000000..9f9afd51 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..bc471a3e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int16.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int16/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: integer(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: integer(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql new file mode 100644 index 00000000..bee9ec27 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..d9a2be6c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Custom.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int32Type extending std::int32 + ``` + """ + @type v4__codegen__int32_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int32_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int32_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql new file mode 100644 index 00000000..1c922c70 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..29f9eaf0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int32Type extending std::int32 + ``` + """ + @type v4__codegen__int32_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__int32_type() | nil}] + @type map_args() :: %{arg: v4__codegen__int32_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int32_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int32_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql new file mode 100644 index 00000000..6581d6d4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..194970cf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int32Type extending std::int32 + ``` + """ + @type v4__codegen__int32_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__int32_type()}] + @type map_args() :: %{arg: v4__codegen__int32_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int32_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int32_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql new file mode 100644 index 00000000..1eec07c9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..39b2f3aa --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int32Type extending std::int32 + ``` + """ + @type v4__codegen__int32_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int32_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int32_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int32_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int32_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql new file mode 100644 index 00000000..a9319cb7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..af27ebd5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int32Type extending std::int32 + ``` + """ + @type v4__codegen__int32_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int32_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int32_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int32_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int32_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql new file mode 100644 index 00000000..43a5d440 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..a3493493 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Std.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql new file mode 100644 index 00000000..bfb3d8a4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..b6fd0018 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, integer() | nil}] + @type map_args() :: %{arg: integer() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: integer() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql new file mode 100644 index 00000000..75d3be40 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..667d5a58 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, integer()}] + @type map_args() :: %{arg: integer()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql new file mode 100644 index 00000000..0a7891c2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..7b1da237 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: integer() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: integer() | nil, + opts :: list(EdgeDB.query_option()) + ) :: integer() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql new file mode 100644 index 00000000..ba9d58c1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..59b1538f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int32.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int32/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: integer(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: integer(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql new file mode 100644 index 00000000..56d6a988 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..9159b57b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Custom.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int64Type extending std::int64 + ``` + """ + @type v4__codegen__int64_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int64_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int64_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql new file mode 100644 index 00000000..05f9548e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..86b91d16 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int64Type extending std::int64 + ``` + """ + @type v4__codegen__int64_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__int64_type() | nil}] + @type map_args() :: %{arg: v4__codegen__int64_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int64_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int64_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql new file mode 100644 index 00000000..3a6e6831 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..97d6655a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int64Type extending std::int64 + ``` + """ + @type v4__codegen__int64_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__int64_type()}] + @type map_args() :: %{arg: v4__codegen__int64_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int64_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int64_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql new file mode 100644 index 00000000..4b75e90b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..96580d9a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int64Type extending std::int64 + ``` + """ + @type v4__codegen__int64_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int64_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int64_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int64_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int64_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql new file mode 100644 index 00000000..2e7a82aa --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..f4216918 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int64Type extending std::int64 + ``` + """ + @type v4__codegen__int64_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int64_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__int64_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__int64_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__int64_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql new file mode 100644 index 00000000..97ba3797 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..0e57577c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Std.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql new file mode 100644 index 00000000..278b0e88 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..045d09bc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, integer() | nil}] + @type map_args() :: %{arg: integer() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: integer() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql new file mode 100644 index 00000000..154a43b2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..40584fba --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, integer()}] + @type map_args() :: %{arg: integer()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql new file mode 100644 index 00000000..28964f9e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..c8fa938f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: integer() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: integer() | nil, + opts :: list(EdgeDB.query_option()) + ) :: integer() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql new file mode 100644 index 00000000..aec33635 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..5c128a12 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Int64.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/int64/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: integer(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, integer()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: integer(), + opts :: list(EdgeDB.query_option()) + ) :: integer() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql new file mode 100644 index 00000000..33b54806 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql @@ -0,0 +1 @@ +select "hello world" diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..a9d2ecc3 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Custom.Literal do + @query """ + select "hello world" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::JsonType extending std::json + ``` + """ + @type v4__codegen__json_type() :: any() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__json_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__json_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql new file mode 100644 index 00000000..5e470b38 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..48d74cd2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::JsonType extending std::json + ``` + """ + @type v4__codegen__json_type() :: any() + + @type keyword_args() :: [{:arg, v4__codegen__json_type() | nil}] + @type map_args() :: %{arg: v4__codegen__json_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__json_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__json_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql new file mode 100644 index 00000000..d114600b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..a334fb1a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::JsonType extending std::json + ``` + """ + @type v4__codegen__json_type() :: any() + + @type keyword_args() :: [{:arg, v4__codegen__json_type()}] + @type map_args() :: %{arg: v4__codegen__json_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__json_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__json_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql new file mode 100644 index 00000000..ae75180d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..4a84845e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::JsonType extending std::json + ``` + """ + @type v4__codegen__json_type() :: any() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__json_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__json_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__json_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__json_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql new file mode 100644 index 00000000..5863acf1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..1eef0b0a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::JsonType extending std::json + ``` + """ + @type v4__codegen__json_type() :: any() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__json_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__json_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__json_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__json_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql new file mode 100644 index 00000000..6d4ca9e0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql @@ -0,0 +1 @@ +select "hello world" diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..339be604 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Std.Literal do + @query """ + select "hello world" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/std/literal.edgeql" + + @typedoc """ + ```edgeql + std::json + ``` + """ + @type json() :: any() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, json()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: json() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql new file mode 100644 index 00000000..337ecca7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..70ca329e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/std/named.optional.edgeql" + + @typedoc """ + ```edgeql + std::json + ``` + """ + @type json() :: any() + + @type keyword_args() :: [{:arg, json() | nil}] + @type map_args() :: %{arg: json() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, json() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: json() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql new file mode 100644 index 00000000..d590898c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..aae2ce43 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/std/named.required.edgeql" + + @typedoc """ + ```edgeql + std::json + ``` + """ + @type json() :: any() + + @type keyword_args() :: [{:arg, json()}] + @type map_args() :: %{arg: json()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, json()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: json() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql new file mode 100644 index 00000000..8bfb842c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..2f37fc6f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/std/positional.optional.edgeql" + + @typedoc """ + ```edgeql + std::json + ``` + """ + @type json() :: any() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: json() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, json() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: json() | nil, + opts :: list(EdgeDB.query_option()) + ) :: json() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql new file mode 100644 index 00000000..a469b84d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..900d369e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Json.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/json/std/positional.required.edgeql" + + @typedoc """ + ```edgeql + std::json + ``` + """ + @type json() :: any() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: json(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, json()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: json(), + opts :: list(EdgeDB.query_option()) + ) :: json() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql new file mode 100644 index 00000000..d25e9801 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql @@ -0,0 +1 @@ +select "hello world" diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..ba4985a9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Custom.Literal do + @query """ + select "hello world" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::StrType extending std::str + ``` + """ + @type v4__codegen__str_type() :: String.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__str_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__str_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql new file mode 100644 index 00000000..65d93d1a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..28f0a7cb --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::StrType extending std::str + ``` + """ + @type v4__codegen__str_type() :: String.t() + + @type keyword_args() :: [{:arg, v4__codegen__str_type() | nil}] + @type map_args() :: %{arg: v4__codegen__str_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__str_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__str_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql new file mode 100644 index 00000000..e7d918e7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..5e3fd18f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::StrType extending std::str + ``` + """ + @type v4__codegen__str_type() :: String.t() + + @type keyword_args() :: [{:arg, v4__codegen__str_type()}] + @type map_args() :: %{arg: v4__codegen__str_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__str_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__str_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql new file mode 100644 index 00000000..cfbe262c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..ad43d3c5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::StrType extending std::str + ``` + """ + @type v4__codegen__str_type() :: String.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__str_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__str_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__str_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__str_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql new file mode 100644 index 00000000..3fc06801 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..d35e6cf0 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::StrType extending std::str + ``` + """ + @type v4__codegen__str_type() :: String.t() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__str_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__str_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__str_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__str_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql new file mode 100644 index 00000000..930d8eff --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql @@ -0,0 +1 @@ +select "hello world" diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..a69d2fde --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Std.Literal do + @query """ + select "hello world" + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/std/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, String.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: String.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql new file mode 100644 index 00000000..83886dec --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..1ea2c642 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/std/named.optional.edgeql" + + @type keyword_args() :: [{:arg, String.t() | nil}] + @type map_args() :: %{arg: String.t() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, String.t() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: String.t() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql new file mode 100644 index 00000000..0206fdfd --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..94d83028 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/std/named.required.edgeql" + + @type keyword_args() :: [{:arg, String.t()}] + @type map_args() :: %{arg: String.t()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, String.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: String.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql new file mode 100644 index 00000000..f86c2182 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..b8e12a60 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/std/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: String.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, String.t() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: String.t() | nil, + opts :: list(EdgeDB.query_option()) + ) :: String.t() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql new file mode 100644 index 00000000..61bc21ea --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..af3ef7ee --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Str.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/str/std/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: String.t(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [String.t()]} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: String.t(), + opts :: list(EdgeDB.query_option()) + ) :: [String.t()] + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql new file mode 100644 index 00000000..028cd692 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql @@ -0,0 +1 @@ +select uuid_generate_v1mc() diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..fbc72a63 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Custom.Literal do + @query """ + select uuid_generate_v1mc() + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::UuidType extending std::uuid + ``` + """ + @type v4__codegen__uuid_type() :: binary() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__uuid_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__uuid_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql new file mode 100644 index 00000000..b3022d8a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..c25d080c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::UuidType extending std::uuid + ``` + """ + @type v4__codegen__uuid_type() :: binary() + + @type keyword_args() :: [{:arg, v4__codegen__uuid_type() | nil}] + @type map_args() :: %{arg: v4__codegen__uuid_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__uuid_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__uuid_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql new file mode 100644 index 00000000..26c64763 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..9febacd5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::UuidType extending std::uuid + ``` + """ + @type v4__codegen__uuid_type() :: binary() + + @type keyword_args() :: [{:arg, v4__codegen__uuid_type()}] + @type map_args() :: %{arg: v4__codegen__uuid_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__uuid_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__uuid_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql new file mode 100644 index 00000000..f813897e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..eb6766c5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::UuidType extending std::uuid + ``` + """ + @type v4__codegen__uuid_type() :: binary() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__uuid_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__uuid_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__uuid_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__uuid_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql new file mode 100644 index 00000000..7dc1f83f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..34bd1ee2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::UuidType extending std::uuid + ``` + """ + @type v4__codegen__uuid_type() :: binary() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__uuid_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__uuid_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__uuid_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__uuid_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql new file mode 100644 index 00000000..8b3bb308 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql @@ -0,0 +1 @@ +select uuid_generate_v1mc() diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..4c43a72b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Std.Literal do + @query """ + select uuid_generate_v1mc() + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/std/literal.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, uuid()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: uuid() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql new file mode 100644 index 00000000..f54504be --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..2c669620 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/std/named.optional.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + @type keyword_args() :: [{:arg, uuid() | nil}] + @type map_args() :: %{arg: uuid() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, uuid() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: uuid() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql new file mode 100644 index 00000000..c1861d82 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..a029b68e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/std/named.required.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + @type keyword_args() :: [{:arg, uuid()}] + @type map_args() :: %{arg: uuid()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, uuid()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: uuid() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql new file mode 100644 index 00000000..342715dc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..1cd8e043 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.optional.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: uuid() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, uuid() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: uuid() | nil, + opts :: list(EdgeDB.query_option()) + ) :: uuid() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql new file mode 100644 index 00000000..0baba00c --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..65c9b5c6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Scalars.Uuid.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/scalars/uuid/std/positional.required.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: uuid(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, uuid()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: uuid(), + opts :: list(EdgeDB.query_option()) + ) :: uuid() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql new file mode 100644 index 00000000..68403a2b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql @@ -0,0 +1 @@ +select 16132 diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..803dcf1f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Sequence.Custom.Literal do + @query """ + select 16132 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/sequence/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::SequenceType extending std::int64 + ``` + """ + @type v4__codegen__sequence_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__sequence_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__sequence_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql new file mode 100644 index 00000000..c18a0607 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..8c90247d --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Sequence.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/sequence/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::SequenceType extending std::int64 + ``` + """ + @type v4__codegen__sequence_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__sequence_type() | nil}] + @type map_args() :: %{arg: v4__codegen__sequence_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__sequence_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__sequence_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql new file mode 100644 index 00000000..a4fa5390 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..3ac93ebc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Sequence.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/sequence/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::SequenceType extending std::int64 + ``` + """ + @type v4__codegen__sequence_type() :: integer() + + @type keyword_args() :: [{:arg, v4__codegen__sequence_type()}] + @type map_args() :: %{arg: v4__codegen__sequence_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__sequence_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__sequence_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql new file mode 100644 index 00000000..d2adc1a5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..5e572e81 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Sequence.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/sequence/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::SequenceType extending std::int64 + ``` + """ + @type v4__codegen__sequence_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__sequence_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__sequence_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__sequence_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__sequence_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql new file mode 100644 index 00000000..666bf057 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..902b4513 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Sequence.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/sequence/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::SequenceType extending std::int64 + ``` + """ + @type v4__codegen__sequence_type() :: integer() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__sequence_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__sequence_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__sequence_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__sequence_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql b/test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql new file mode 100644 index 00000000..68a9bbf1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql @@ -0,0 +1 @@ +select (a := 42, b := true) diff --git a/test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql.ex.assert new file mode 100644 index 00000000..e6a3cef5 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql.ex.assert @@ -0,0 +1,64 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Named.Literal do + @query """ + select (a := 42, b := true) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/named/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, %{a: integer(), b: boolean()}} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: %{a: integer(), b: boolean()} + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + %{ + a: entity["a"], + b: entity["b"] + } + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql b/test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql new file mode 100644 index 00000000..87ae3b9e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..974bc914 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql.ex.assert @@ -0,0 +1,72 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Named.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/named/named.optional.edgeql" + + @type keyword_args() :: [{:arg, %{a: String.t(), b: boolean()} | nil}] + @type map_args() :: %{arg: %{a: String.t(), b: boolean()} | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, %{a: String.t(), b: boolean()} | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: %{a: String.t(), b: boolean()} | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} when not is_nil(entity) <- EdgeDB.query_single(client, @query, args, opts) do + result = + with element when not is_nil(element) <- entity do + %{ + a: element["a"], + b: element["b"] + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql b/test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql new file mode 100644 index 00000000..6c58e433 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql.ex.assert new file mode 100644 index 00000000..908cc08f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql.ex.assert @@ -0,0 +1,70 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Named.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/named/named.required.edgeql" + + @type keyword_args() :: [{:arg, %{a: String.t(), b: boolean()}}] + @type map_args() :: %{arg: %{a: String.t(), b: boolean()}} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, %{a: String.t(), b: boolean()}} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: %{a: String.t(), b: boolean()} + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + %{ + a: entity["a"], + b: entity["b"] + } + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql new file mode 100644 index 00000000..0154a7dc --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..90817f75 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql.ex.assert @@ -0,0 +1,71 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Named.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/named/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: %{a: String.t(), b: boolean()} | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, %{a: String.t(), b: boolean()} | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: %{a: String.t(), b: boolean()} | nil, + opts :: list(EdgeDB.query_option()) + ) :: %{a: String.t(), b: boolean()} | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} when not is_nil(entity) <- EdgeDB.query_single(client, @query, args, opts) do + result = + with element when not is_nil(element) <- entity do + %{ + a: element["a"], + b: element["b"] + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql b/test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql new file mode 100644 index 00000000..5c8bde6f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..1f429871 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Named.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/named/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: %{a: String.t(), b: boolean()}, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, %{a: String.t(), b: boolean()}} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: %{a: String.t(), b: boolean()}, + opts :: list(EdgeDB.query_option()) + ) :: %{a: String.t(), b: boolean()} + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + %{ + a: entity["a"], + b: entity["b"] + } + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql b/test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql new file mode 100644 index 00000000..7c68b256 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql @@ -0,0 +1 @@ +select (42, true) diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql.ex.assert new file mode 100644 index 00000000..b32cb4ec --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql.ex.assert @@ -0,0 +1,56 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Unnamed.Literal do + @query """ + select (42, true) + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/unnamed/literal.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, {integer(), boolean()}} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {integer(), boolean()} + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql new file mode 100644 index 00000000..732a4ac9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..59f44295 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Unnamed.Named.Optional do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/unnamed/named.optional.edgeql" + + @type keyword_args() :: [{:arg, {String.t(), boolean()} | nil}] + @type map_args() :: %{arg: {String.t(), boolean()} | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, {String.t(), boolean()} | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {String.t(), boolean()} | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql new file mode 100644 index 00000000..ee0a6522 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql @@ -0,0 +1 @@ +select >$arg diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql.ex.assert new file mode 100644 index 00000000..c083a6d4 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql.ex.assert @@ -0,0 +1,62 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Unnamed.Named.Required do + @query """ + select >$arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/unnamed/named.required.edgeql" + + @type keyword_args() :: [{:arg, {String.t(), boolean()}}] + @type map_args() :: %{arg: {String.t(), boolean()}} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, {String.t(), boolean()}} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {String.t(), boolean()} + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql new file mode 100644 index 00000000..d8ea1863 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..318d2997 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Unnamed.Positional.Optional do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/unnamed/positional.optional.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: {String.t(), boolean()} | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, {String.t(), boolean()} | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: {String.t(), boolean()} | nil, + opts :: list(EdgeDB.query_option()) + ) :: {String.t(), boolean()} | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql new file mode 100644 index 00000000..cd362dd2 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql @@ -0,0 +1 @@ +select >$0 diff --git a/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..bcfd5f43 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql.ex.assert @@ -0,0 +1,61 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Tuple.Unnamed.Positional.Required do + @query """ + select >$0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/tuple/unnamed/positional.required.edgeql" + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: {String.t(), boolean()}, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, {String.t(), boolean()}} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: {String.t(), boolean()}, + opts :: list(EdgeDB.query_option()) + ) :: {String.t(), boolean()} + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql b/test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql new file mode 100644 index 00000000..f42f9248 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql @@ -0,0 +1 @@ +select [1.5, 2.0, 4.5] diff --git a/test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql.ex.assert new file mode 100644 index 00000000..68cd4aab --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Custom.Literal do + @query """ + select [1.5, 2.0, 4.5] + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/custom/literal.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::VectorType extending ext::pgvector::vector + ``` + """ + @type v4__codegen__vector_type() :: [float()] + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__vector_type()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__vector_type() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql b/test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql new file mode 100644 index 00000000..b9004f2a --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..c214dcdf --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Custom.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/custom/named.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::VectorType extending ext::pgvector::vector + ``` + """ + @type v4__codegen__vector_type() :: [float()] + + @type keyword_args() :: [{:arg, v4__codegen__vector_type() | nil}] + @type map_args() :: %{arg: v4__codegen__vector_type() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__vector_type() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__vector_type() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql b/test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql new file mode 100644 index 00000000..ed2ebfd7 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql.ex.assert new file mode 100644 index 00000000..9aad58f1 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Custom.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/custom/named.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::VectorType extending ext::pgvector::vector + ``` + """ + @type v4__codegen__vector_type() :: [float()] + + @type keyword_args() :: [{:arg, v4__codegen__vector_type()}] + @type map_args() :: %{arg: v4__codegen__vector_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__vector_type()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__vector_type() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql new file mode 100644 index 00000000..0a69e74e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..6921670e --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Custom.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/custom/positional.optional.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::VectorType extending ext::pgvector::vector + ``` + """ + @type v4__codegen__vector_type() :: [float()] + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__vector_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__vector_type() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__vector_type() | nil, + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__vector_type() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql b/test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql new file mode 100644 index 00000000..69ccc09f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..be0486df --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Custom.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/custom/positional.required.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::VectorType extending ext::pgvector::vector + ``` + """ + @type v4__codegen__vector_type() :: [float()] + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__vector_type(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, v4__codegen__vector_type()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: v4__codegen__vector_type(), + opts :: list(EdgeDB.query_option()) + ) :: v4__codegen__vector_type() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/std/literal.edgeql b/test/support/codegen/edgeql/primitives/vector/std/literal.edgeql new file mode 100644 index 00000000..8edf8d5b --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/literal.edgeql @@ -0,0 +1 @@ +select [1.5, 2.0, 4.5] diff --git a/test/support/codegen/edgeql/primitives/vector/std/literal.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/std/literal.edgeql.ex.assert new file mode 100644 index 00000000..30ccfd91 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/literal.edgeql.ex.assert @@ -0,0 +1,63 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/std/literal.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Std.Literal do + @query """ + select [1.5, 2.0, 4.5] + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/std/literal.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/std/literal.edgeql" + + @typedoc """ + ```edgeql + ext::pgvector::vector + ``` + """ + @type vector() :: [float()] + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, vector()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: vector() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql b/test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql new file mode 100644 index 00000000..6136e7ca --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql.ex.assert new file mode 100644 index 00000000..940abd43 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Std.Named.Optional do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/std/named.optional.edgeql" + + @typedoc """ + ```edgeql + ext::pgvector::vector + ``` + """ + @type vector() :: [float()] + + @type keyword_args() :: [{:arg, vector() | nil}] + @type map_args() :: %{arg: vector() | nil} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, vector() | nil} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: vector() | nil + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql b/test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql new file mode 100644 index 00000000..ccbf21c6 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql @@ -0,0 +1 @@ +select $arg diff --git a/test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql.ex.assert new file mode 100644 index 00000000..64507708 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql.ex.assert @@ -0,0 +1,69 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Std.Named.Required do + @query """ + select $arg + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/std/named.required.edgeql" + + @typedoc """ + ```edgeql + ext::pgvector::vector + ``` + """ + @type vector() :: [float()] + + @type keyword_args() :: [{:arg, vector()}] + @type map_args() :: %{arg: vector()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, vector()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: vector() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql b/test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql new file mode 100644 index 00000000..8d34b21f --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql.ex.assert new file mode 100644 index 00000000..afacc347 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Std.Positional.Optional do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/std/positional.optional.edgeql" + + @typedoc """ + ```edgeql + ext::pgvector::vector + ``` + """ + @type vector() :: [float()] + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: vector() | nil, + opts :: list(EdgeDB.query_option()) + ) :: {:ok, vector() | nil} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: vector() | nil, + opts :: list(EdgeDB.query_option()) + ) :: vector() | nil + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql b/test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql new file mode 100644 index 00000000..ca778dca --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql @@ -0,0 +1 @@ +select $0 diff --git a/test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql.ex.assert b/test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql.ex.assert new file mode 100644 index 00000000..8a8b55c9 --- /dev/null +++ b/test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql.ex.assert @@ -0,0 +1,68 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql`. +defmodule Tests.Codegen.Queries.Primitives.Vector.Std.Positional.Required do + @query """ + select $0 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/primitives/vector/std/positional.required.edgeql" + + @typedoc """ + ```edgeql + ext::pgvector::vector + ``` + """ + @type vector() :: [float()] + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + arg_0 :: vector(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, vector()} | {:error, reason} + when reason: any() + def query(client, arg_0, opts \\ []) do + args = [arg_0] + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + arg_0 :: vector(), + opts :: list(EdgeDB.query_option()) + ) :: vector() + def query!(client, arg_0, opts \\ []) do + args = [arg_0] + + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + EdgeDB.query_required_single(client, @query, args, opts) + end +end diff --git a/test/support/codegen/edgeql/types/insert/basic.edgeql b/test/support/codegen/edgeql/types/insert/basic.edgeql new file mode 100644 index 00000000..dcdf0551 --- /dev/null +++ b/test/support/codegen/edgeql/types/insert/basic.edgeql @@ -0,0 +1,4 @@ +insert v4::codegen::StrPropertiesType { + rp_str := $rp_str, + rp_str_type := $rp_str_type, +} diff --git a/test/support/codegen/edgeql/types/insert/basic.edgeql.ex.assert b/test/support/codegen/edgeql/types/insert/basic.edgeql.ex.assert new file mode 100644 index 00000000..1a77eb39 --- /dev/null +++ b/test/support/codegen/edgeql/types/insert/basic.edgeql.ex.assert @@ -0,0 +1,85 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/insert/basic.edgeql`. +defmodule Tests.Codegen.Queries.Types.Insert.Basic do + @query """ + insert v4::codegen::StrPropertiesType { + rp_str := $rp_str, + rp_str_type := $rp_str_type, + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/insert/basic.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/insert/basic.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::StrType extending std::str + ``` + """ + @type v4__codegen__str_type() :: String.t() + + defmodule Result do + @moduledoc false + + defstruct [] + + @type t() :: %__MODULE__{} + end + + @type keyword_args() :: [{:rp_str, String.t()} | {:rp_str_type, v4__codegen__str_type()}] + @type map_args() :: %{rp_str: String.t(), rp_str_type: v4__codegen__str_type()} + @type args() :: map_args() | keyword_args() + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Result.t()} | {:error, reason} + when reason: any() + def query(client, args, opts \\ []) do + do_query(client, args, opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + args :: args(), + opts :: list(EdgeDB.query_option()) + ) :: Result.t() + def query!(client, args, opts \\ []) do + case do_query(client, args, opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, _entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + %Result{} + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/basic.edgeql b/test/support/codegen/edgeql/types/select/basic.edgeql new file mode 100644 index 00000000..f5b981ad --- /dev/null +++ b/test/support/codegen/edgeql/types/select/basic.edgeql @@ -0,0 +1,4 @@ +select v4::codegen::Aggregate { + id, + computed_rl_number_ml_int16_rp_int16_type := .rl_number.ml_int16.rp_int16_type +} diff --git a/test/support/codegen/edgeql/types/select/basic.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/basic.edgeql.ex.assert new file mode 100644 index 00000000..3931cebe --- /dev/null +++ b/test/support/codegen/edgeql/types/select/basic.edgeql.ex.assert @@ -0,0 +1,100 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/basic.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Basic do + @query """ + select v4::codegen::Aggregate { + id, + computed_rl_number_ml_int16_rp_int16_type := .rl_number.ml_int16.rp_int16_type + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/basic.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/basic.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int16Type extending std::int16 + ``` + """ + @type v4__codegen__int16_type() :: integer() + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + defmodule Result do + @moduledoc false + + defstruct [ + :id, + :computed_rl_number_ml_int16_rp_int16_type + ] + + @type t() :: %__MODULE__{ + id: Tests.Codegen.Queries.Types.Select.Basic.uuid(), + computed_rl_number_ml_int16_rp_int16_type: [ + Tests.Codegen.Queries.Types.Select.Basic.v4__codegen__int16_type() + ] + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [Result.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [Result.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, set} <- EdgeDB.query(client, @query, args, opts) do + result = + for element <- set do + %Result{ + id: element["id"], + computed_rl_number_ml_int16_rp_int16_type: + element["computed_rl_number_ml_int16_rp_int16_type"] + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/links/convertors.edgeql b/test/support/codegen/edgeql/types/select/links/convertors.edgeql new file mode 100644 index 00000000..d238b26e --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/convertors.edgeql @@ -0,0 +1,16 @@ +select v4::codegen::Aggregate { + rl_number: { + ol_int64: { + mp_int64, + mp_int64_type, + } + }, + ml_tuple: { + rl_unnamed_tuple: { + op_unnamed_tuple, + }, + ol_named_tuple: { + rp_named_tuple, + } + } +} diff --git a/test/support/codegen/edgeql/types/select/links/convertors.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/links/convertors.edgeql.ex.assert new file mode 100644 index 00000000..a0af621a --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/convertors.edgeql.ex.assert @@ -0,0 +1,269 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/links/convertors.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Links.Convertors do + @query """ + select v4::codegen::Aggregate { + rl_number: { + ol_int64: { + mp_int64, + mp_int64_type, + } + }, + ml_tuple: { + rl_unnamed_tuple: { + op_unnamed_tuple, + }, + ol_named_tuple: { + rp_named_tuple, + } + } + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/links/convertors.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/links/convertors.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int64Type extending std::int64 + ``` + """ + @type v4__codegen__int64_type() :: integer() + + @typedoc """ + ```edgeql + scalar type v4::codegen::EnumType extending enum + ``` + """ + @type v4__codegen__enum_type() :: :A | :B | :C + + defmodule Result do + @moduledoc false + + defmodule RlNumber do + @moduledoc false + + defmodule OlInt64 do + @moduledoc false + + defstruct [ + :mp_int64, + :mp_int64_type + ] + + @type t() :: %__MODULE__{ + mp_int64: [integer()], + mp_int64_type: [ + Tests.Codegen.Queries.Types.Select.Links.Convertors.v4__codegen__int64_type() + ] + } + end + + defstruct [ + :ol_int64 + ] + + @type t() :: %__MODULE__{ + ol_int64: OlInt64.t() | nil + } + end + + defmodule MlTuple do + @moduledoc false + + defmodule RlUnnamedTuple do + @moduledoc false + + defstruct [ + :op_unnamed_tuple + ] + + @type t() :: %__MODULE__{ + op_unnamed_tuple: + {String.t(), boolean(), + {String.t(), boolean(), + Tests.Codegen.Queries.Types.Select.Links.Convertors.v4__codegen__enum_type()}} + | nil + } + end + + defmodule OlNamedTuple do + @moduledoc false + + defstruct [ + :rp_named_tuple + ] + + @type t() :: %__MODULE__{ + rp_named_tuple: %{ + a: String.t(), + b: boolean(), + c: %{ + a: String.t(), + b: boolean(), + c: + Tests.Codegen.Queries.Types.Select.Links.Convertors.v4__codegen__enum_type() + } + } + } + end + + defstruct [ + :rl_unnamed_tuple, + :ol_named_tuple + ] + + @type t() :: %__MODULE__{ + rl_unnamed_tuple: RlUnnamedTuple.t(), + ol_named_tuple: OlNamedTuple.t() | nil + } + end + + defstruct [ + :rl_number, + :ml_tuple + ] + + @type t() :: %__MODULE__{ + rl_number: RlNumber.t(), + ml_tuple: [MlTuple.t()] + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [Result.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [Result.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, set} <- EdgeDB.query(client, @query, args, opts) do + result = + for element <- set do + %Result{ + rl_number: + with link <- element["rl_number"] do + %Result.RlNumber{ + ol_int64: + with link when not is_nil(link) <- link["ol_int64"] do + %Result.RlNumber.OlInt64{ + mp_int64: link["mp_int64"], + mp_int64_type: link["mp_int64_type"] + } + end + } + end, + ml_tuple: + with link <- element["ml_tuple"] do + for element <- link do + %Result.MlTuple{ + rl_unnamed_tuple: + with link <- element["rl_unnamed_tuple"] do + %Result.MlTuple.RlUnnamedTuple{ + op_unnamed_tuple: + with property when not is_nil(property) <- link["op_unnamed_tuple"] do + with { + element_0, + element_1, + element_2 + } <- property do + { + element_0, + element_1, + with element <- element_2 do + with { + element_0, + element_1, + element_2 + } <- element do + { + element_0, + element_1, + with element <- element_2 do + case element do + "A" -> :A + "B" -> :B + "C" -> :C + end + end + } + end + end + } + end + end + } + end, + ol_named_tuple: + with link when not is_nil(link) <- element["ol_named_tuple"] do + %Result.MlTuple.OlNamedTuple{ + rp_named_tuple: + with property <- link["rp_named_tuple"] do + %{ + a: property["a"], + b: property["b"], + c: + with element <- property["c"] do + %{ + a: element["a"], + b: element["b"], + c: + with element <- element["c"] do + case element do + "A" -> :A + "B" -> :B + "C" -> :C + end + end + } + end + } + end + } + end + } + end + end + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/links/multi.edgeql b/test/support/codegen/edgeql/types/select/links/multi.edgeql new file mode 100644 index 00000000..eba1b2a4 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/multi.edgeql @@ -0,0 +1,8 @@ +select v4::codegen::Aggregate { + rl_number: { + ml_int16: { + op_int16, + rp_int16_type, + }, + }, +} diff --git a/test/support/codegen/edgeql/types/select/links/multi.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/links/multi.edgeql.ex.assert new file mode 100644 index 00000000..3cea26b4 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/multi.edgeql.ex.assert @@ -0,0 +1,131 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/links/multi.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Links.Multi do + @query """ + select v4::codegen::Aggregate { + rl_number: { + ml_int16: { + op_int16, + rp_int16_type, + }, + }, + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/links/multi.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/links/multi.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int16Type extending std::int16 + ``` + """ + @type v4__codegen__int16_type() :: integer() + + defmodule Result do + @moduledoc false + + defmodule RlNumber do + @moduledoc false + + defmodule MlInt16 do + @moduledoc false + + defstruct [ + :op_int16, + :rp_int16_type + ] + + @type t() :: %__MODULE__{ + op_int16: integer() | nil, + rp_int16_type: + Tests.Codegen.Queries.Types.Select.Links.Multi.v4__codegen__int16_type() + } + end + + defstruct [ + :ml_int16 + ] + + @type t() :: %__MODULE__{ + ml_int16: [MlInt16.t()] + } + end + + defstruct [ + :rl_number + ] + + @type t() :: %__MODULE__{ + rl_number: RlNumber.t() + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [Result.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [Result.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, set} <- EdgeDB.query(client, @query, args, opts) do + result = + for element <- set do + %Result{ + rl_number: + with link <- element["rl_number"] do + %Result.RlNumber{ + ml_int16: + with link <- link["ml_int16"] do + for element <- link do + %Result.RlNumber.MlInt16{ + op_int16: element["op_int16"], + rp_int16_type: element["rp_int16_type"] + } + end + end + } + end + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/links/nested.edgeql b/test/support/codegen/edgeql/types/select/links/nested.edgeql new file mode 100644 index 00000000..91a49449 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/nested.edgeql @@ -0,0 +1,10 @@ +select v4::codegen::Aggregate { + rl_number: { + id, + ml_int32: { + op_int32, + op_int32_type, + }, + rl_decimal, + }, +} diff --git a/test/support/codegen/edgeql/types/select/links/nested.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/links/nested.edgeql.ex.assert new file mode 100644 index 00000000..1a8a8ba1 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/nested.edgeql.ex.assert @@ -0,0 +1,157 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/links/nested.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Links.Nested do + @query """ + select v4::codegen::Aggregate { + rl_number: { + id, + ml_int32: { + op_int32, + op_int32_type, + }, + rl_decimal, + }, + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/links/nested.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/links/nested.edgeql" + + @typedoc """ + ```edgeql + scalar type v4::codegen::Int32Type extending std::int32 + ``` + """ + @type v4__codegen__int32_type() :: integer() + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + defmodule Result do + @moduledoc false + + defmodule RlNumber do + @moduledoc false + + defmodule MlInt32 do + @moduledoc false + + defstruct [ + :op_int32, + :op_int32_type + ] + + @type t() :: %__MODULE__{ + op_int32: integer() | nil, + op_int32_type: + Tests.Codegen.Queries.Types.Select.Links.Nested.v4__codegen__int32_type() | nil + } + end + + defmodule RlDecimal do + @moduledoc false + + defstruct [] + + @type t() :: %__MODULE__{} + end + + defstruct [ + :id, + :ml_int32, + :rl_decimal + ] + + @type t() :: %__MODULE__{ + id: Tests.Codegen.Queries.Types.Select.Links.Nested.uuid(), + ml_int32: [MlInt32.t()], + rl_decimal: RlDecimal.t() + } + end + + defstruct [ + :rl_number + ] + + @type t() :: %__MODULE__{ + rl_number: RlNumber.t() + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [Result.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [Result.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, set} <- EdgeDB.query(client, @query, args, opts) do + result = + for element <- set do + %Result{ + rl_number: + with link <- element["rl_number"] do + %Result.RlNumber{ + id: link["id"], + ml_int32: + with link <- link["ml_int32"] do + for element <- link do + %Result.RlNumber.MlInt32{ + op_int32: element["op_int32"], + op_int32_type: element["op_int32_type"] + } + end + end, + rl_decimal: + with _link <- link["rl_decimal"] do + %Result.RlNumber.RlDecimal{} + end + } + end + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/links/optional.edgeql b/test/support/codegen/edgeql/types/select/links/optional.edgeql new file mode 100644 index 00000000..d87cdc41 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/optional.edgeql @@ -0,0 +1,5 @@ +select v4::codegen::Aggregate { + ol_number: { + id, + }, +} diff --git a/test/support/codegen/edgeql/types/select/links/optional.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/links/optional.edgeql.ex.assert new file mode 100644 index 00000000..1217eb58 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/optional.edgeql.ex.assert @@ -0,0 +1,105 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/links/optional.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Links.Optional do + @query """ + select v4::codegen::Aggregate { + ol_number: { + id, + }, + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/links/optional.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/links/optional.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + defmodule Result do + @moduledoc false + + defmodule OlNumber do + @moduledoc false + + defstruct [ + :id + ] + + @type t() :: %__MODULE__{ + id: Tests.Codegen.Queries.Types.Select.Links.Optional.uuid() + } + end + + defstruct [ + :ol_number + ] + + @type t() :: %__MODULE__{ + ol_number: OlNumber.t() | nil + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [Result.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [Result.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, set} <- EdgeDB.query(client, @query, args, opts) do + result = + for element <- set do + %Result{ + ol_number: + with link when not is_nil(link) <- element["ol_number"] do + %Result.OlNumber{ + id: link["id"] + } + end + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/links/required.edgeql b/test/support/codegen/edgeql/types/select/links/required.edgeql new file mode 100644 index 00000000..989b33be --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/required.edgeql @@ -0,0 +1,5 @@ +select v4::codegen::Aggregate { + rl_number: { + id, + }, +} diff --git a/test/support/codegen/edgeql/types/select/links/required.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/links/required.edgeql.ex.assert new file mode 100644 index 00000000..cb44e850 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/links/required.edgeql.ex.assert @@ -0,0 +1,105 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/links/required.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Links.Required do + @query """ + select v4::codegen::Aggregate { + rl_number: { + id, + }, + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/links/required.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/links/required.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + defmodule Result do + @moduledoc false + + defmodule RlNumber do + @moduledoc false + + defstruct [ + :id + ] + + @type t() :: %__MODULE__{ + id: Tests.Codegen.Queries.Types.Select.Links.Required.uuid() + } + end + + defstruct [ + :rl_number + ] + + @type t() :: %__MODULE__{ + rl_number: RlNumber.t() + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [Result.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [Result.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, set} <- EdgeDB.query(client, @query, args, opts) do + result = + for element <- set do + %Result{ + rl_number: + with link <- element["rl_number"] do + %Result.RlNumber{ + id: link["id"] + } + end + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/multi.edgeql b/test/support/codegen/edgeql/types/select/multi.edgeql new file mode 100644 index 00000000..67a7b8ae --- /dev/null +++ b/test/support/codegen/edgeql/types/select/multi.edgeql @@ -0,0 +1,3 @@ +select v4::codegen::Aggregate { + id, +} diff --git a/test/support/codegen/edgeql/types/select/multi.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/multi.edgeql.ex.assert new file mode 100644 index 00000000..2ee9c14a --- /dev/null +++ b/test/support/codegen/edgeql/types/select/multi.edgeql.ex.assert @@ -0,0 +1,86 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/multi.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Multi do + @query """ + select v4::codegen::Aggregate { + id, + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/multi.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/multi.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + defmodule Result do + @moduledoc false + + defstruct [ + :id + ] + + @type t() :: %__MODULE__{ + id: Tests.Codegen.Queries.Types.Select.Multi.uuid() + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, [Result.t()]} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: [Result.t()] + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, set} <- EdgeDB.query(client, @query, args, opts) do + result = + for element <- set do + %Result{ + id: element["id"] + } + end + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/required_single.edgeql b/test/support/codegen/edgeql/types/select/required_single.edgeql new file mode 100644 index 00000000..0b3a0b50 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/required_single.edgeql @@ -0,0 +1,3 @@ +select assert_exists(assert_single(v4::codegen::Aggregate)) { + id, +} diff --git a/test/support/codegen/edgeql/types/select/required_single.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/required_single.edgeql.ex.assert new file mode 100644 index 00000000..5b1c69a2 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/required_single.edgeql.ex.assert @@ -0,0 +1,84 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/required_single.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.RequiredSingle do + @query """ + select assert_exists(assert_single(v4::codegen::Aggregate)) { + id, + } + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/required_single.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/required_single.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + defmodule Result do + @moduledoc false + + defstruct [ + :id + ] + + @type t() :: %__MODULE__{ + id: Tests.Codegen.Queries.Types.Select.RequiredSingle.uuid() + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Result.t()} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: Result.t() + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} <- EdgeDB.query_required_single(client, @query, args, opts) do + result = + %Result{ + id: entity["id"] + } + + {:ok, result} + end + end +end diff --git a/test/support/codegen/edgeql/types/select/single.edgeql b/test/support/codegen/edgeql/types/select/single.edgeql new file mode 100644 index 00000000..3e5bcfa0 --- /dev/null +++ b/test/support/codegen/edgeql/types/select/single.edgeql @@ -0,0 +1,4 @@ +select v4::codegen::Aggregate { + id, +} +limit 1 diff --git a/test/support/codegen/edgeql/types/select/single.edgeql.ex.assert b/test/support/codegen/edgeql/types/select/single.edgeql.ex.assert new file mode 100644 index 00000000..76ff5adc --- /dev/null +++ b/test/support/codegen/edgeql/types/select/single.edgeql.ex.assert @@ -0,0 +1,87 @@ +# AUTOGENERATED: DO NOT MODIFY +# Generated by Elixir client for EdgeDB via `mix edgedb.generate` from +# `test/support/codegen/edgeql/types/select/single.edgeql`. +defmodule Tests.Codegen.Queries.Types.Select.Single do + @query """ + select v4::codegen::Aggregate { + id, + } + limit 1 + """ + + @moduledoc """ + Generated module for the EdgeQL query from + `test/support/codegen/edgeql/types/select/single.edgeql`. + + Query: + + ```edgeql + #{@query} + ``` + """ + + @query_file "test/support/codegen/edgeql/types/select/single.edgeql" + + @typedoc """ + ```edgeql + std::uuid + ``` + """ + @type uuid() :: binary() + + defmodule Result do + @moduledoc false + + defstruct [ + :id + ] + + @type t() :: %__MODULE__{ + id: Tests.Codegen.Queries.Types.Select.Single.uuid() + } + end + + @doc """ + Run the query. + """ + @spec query( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: {:ok, Result.t() | nil} | {:error, reason} + when reason: any() + def query(client, opts \\ []) do + do_query(client, [], opts) + end + + @doc """ + Run the query. + """ + @spec query!( + client :: EdgeDB.client(), + opts :: list(EdgeDB.query_option()) + ) :: Result.t() | nil + def query!(client, opts \\ []) do + case do_query(client, [], opts) do + {:ok, result} -> + result + + {:error, exc} -> + raise exc + end + end + + defp do_query(client, args, opts) do + opts = Keyword.merge(opts, __file__: @query_file) + + with {:ok, entity} when not is_nil(entity) <- EdgeDB.query_single(client, @query, args, opts) do + result = + with element when not is_nil(element) <- entity do + %Result{ + id: element["id"] + } + end + + {:ok, result} + end + end +end diff --git a/test/support/edgedb_case.ex b/test/support/edgedb_case.ex index 424ef14e..204ae723 100644 --- a/test/support/edgedb_case.ex +++ b/test/support/edgedb_case.ex @@ -51,10 +51,7 @@ defmodule Tests.Support.EdgeDBCase do def edgedb_client(_context) do {:ok, client} = start_supervised( - {EdgeDB, - tls_security: :insecure, - max_concurrency: 1, - show_sensitive_data_on_connection_error: true} + {EdgeDB, tls_security: :insecure, max_concurrency: 1, show_sensitive_data_on_connection_error: true} ) %{client: client} diff --git a/priv/edgedb/schema/migrations/00001.edgeql b/test/support/schema/migrations/00001.edgeql similarity index 100% rename from priv/edgedb/schema/migrations/00001.edgeql rename to test/support/schema/migrations/00001.edgeql diff --git a/priv/edgedb/schema/migrations/00002.edgeql b/test/support/schema/migrations/00002.edgeql similarity index 100% rename from priv/edgedb/schema/migrations/00002.edgeql rename to test/support/schema/migrations/00002.edgeql diff --git a/priv/edgedb/schema/migrations/00003.edgeql b/test/support/schema/migrations/00003.edgeql similarity index 100% rename from priv/edgedb/schema/migrations/00003.edgeql rename to test/support/schema/migrations/00003.edgeql diff --git a/priv/edgedb/schema/migrations/00004.edgeql b/test/support/schema/migrations/00004.edgeql similarity index 100% rename from priv/edgedb/schema/migrations/00004.edgeql rename to test/support/schema/migrations/00004.edgeql diff --git a/test/support/schema/migrations/00005.edgeql b/test/support/schema/migrations/00005.edgeql new file mode 100644 index 00000000..f3608232 --- /dev/null +++ b/test/support/schema/migrations/00005.edgeql @@ -0,0 +1,485 @@ +CREATE MIGRATION m1zmfkfwyx6cxkb6iebiq2xaljf7e5wnutvia3c4ivcskpjd42txva + ONTO m12bi2uxbraa4docb2s3ajj5eodgcc2gbno6cf2jrwudhz6mhhdvta +{ + CREATE MODULE v4::codegen IF NOT EXISTS; + CREATE TYPE v4::codegen::ArrayPropertiesType { + CREATE MULTI PROPERTY mp_array: array; + CREATE PROPERTY op_array: array; + CREATE REQUIRED PROPERTY rp_array: array; + }; + CREATE SCALAR TYPE v4::codegen::BoolType EXTENDING std::bool; + CREATE TYPE v4::codegen::BoolPropertiesType { + CREATE MULTI PROPERTY mp_bool: std::bool; + CREATE MULTI PROPERTY mp_bool_type: v4::codegen::BoolType; + CREATE PROPERTY op_bool: std::bool; + CREATE PROPERTY op_bool_type: v4::codegen::BoolType; + CREATE REQUIRED PROPERTY rp_bool: std::bool; + CREATE REQUIRED PROPERTY rp_bool_type: v4::codegen::BoolType; + }; + CREATE SCALAR TYPE v4::codegen::CfgMemoryType EXTENDING cfg::memory; + CREATE TYPE v4::codegen::CfgMemoryPropertiesType { + CREATE MULTI PROPERTY mp_cfg_memory: cfg::memory; + CREATE MULTI PROPERTY mp_cfg_memory_type: v4::codegen::CfgMemoryType; + CREATE PROPERTY op_cfg_memory: cfg::memory; + CREATE PROPERTY op_cfg_memory_type: v4::codegen::CfgMemoryType; + CREATE REQUIRED PROPERTY rp_cfg_memory: cfg::memory; + CREATE REQUIRED PROPERTY rp_cfg_memory_type: v4::codegen::CfgMemoryType; + }; + CREATE TYPE v4::codegen::CfgPropertiesType { + CREATE MULTI LINK ml_cfg_memory: v4::codegen::CfgMemoryPropertiesType; + CREATE LINK ol_cfg_memory: v4::codegen::CfgMemoryPropertiesType; + CREATE REQUIRED LINK rl_cfg_memory: v4::codegen::CfgMemoryPropertiesType; + }; + CREATE SCALAR TYPE v4::codegen::CalDateDurationType EXTENDING cal::date_duration; + CREATE TYPE v4::codegen::CalDateDurationPropertiesType { + CREATE MULTI PROPERTY mp_cal_date_duration: cal::date_duration; + CREATE MULTI PROPERTY mp_cal_date_duration_type: v4::codegen::CalDateDurationType; + CREATE PROPERTY op_cal_date_duration: cal::date_duration; + CREATE PROPERTY op_cal_date_duration_type: v4::codegen::CalDateDurationType; + CREATE REQUIRED PROPERTY rp_cal_date_duration: cal::date_duration; + CREATE REQUIRED PROPERTY rp_cal_date_duration_type: v4::codegen::CalDateDurationType; + }; + CREATE SCALAR TYPE v4::codegen::CalLocalDateType EXTENDING cal::local_date; + CREATE TYPE v4::codegen::CalLocalDatePropertiesType { + CREATE MULTI PROPERTY mp_cal_local_date: cal::local_date; + CREATE MULTI PROPERTY mp_cal_local_date_type: v4::codegen::CalLocalDateType; + CREATE PROPERTY op_cal_local_date: cal::local_date; + CREATE PROPERTY op_cal_local_date_type: v4::codegen::CalLocalDateType; + CREATE REQUIRED PROPERTY rp_cal_local_date: cal::local_date; + CREATE REQUIRED PROPERTY rp_cal_local_date_type: v4::codegen::CalLocalDateType; + }; + CREATE SCALAR TYPE v4::codegen::CalLocalDatetimeType EXTENDING cal::local_datetime; + CREATE TYPE v4::codegen::CalLocalDatetimePropertiesType { + CREATE MULTI PROPERTY mp_cal_local_datetime: cal::local_datetime; + CREATE MULTI PROPERTY mp_cal_local_datetime_type: v4::codegen::CalLocalDatetimeType; + CREATE PROPERTY op_cal_local_datetime: cal::local_datetime; + CREATE PROPERTY op_cal_local_datetime_type: v4::codegen::CalLocalDatetimeType; + CREATE REQUIRED PROPERTY rp_cal_local_datetime: cal::local_datetime; + CREATE REQUIRED PROPERTY rp_cal_local_datetime_type: v4::codegen::CalLocalDatetimeType; + }; + CREATE SCALAR TYPE v4::codegen::CalLocalTimeType EXTENDING cal::local_time; + CREATE TYPE v4::codegen::CalLocalTimePropertiesType { + CREATE MULTI PROPERTY mp_cal_local_time: cal::local_time; + CREATE MULTI PROPERTY mp_cal_local_time_type: v4::codegen::CalLocalTimeType; + CREATE PROPERTY op_cal_local_time: cal::local_time; + CREATE PROPERTY op_cal_local_time_type: v4::codegen::CalLocalTimeType; + CREATE REQUIRED PROPERTY rp_cal_local_time: cal::local_time; + CREATE REQUIRED PROPERTY rp_cal_local_time_type: v4::codegen::CalLocalTimeType; + }; + CREATE SCALAR TYPE v4::codegen::CalRelativeDurationType EXTENDING cal::relative_duration; + CREATE TYPE v4::codegen::CalRelativeDurationPropertiesType { + CREATE MULTI PROPERTY mp_cal_relative_duration: cal::relative_duration; + CREATE MULTI PROPERTY mp_cal_relative_duration_type: v4::codegen::CalRelativeDurationType; + CREATE PROPERTY op_cal_relative_duration: cal::relative_duration; + CREATE PROPERTY op_cal_relative_duration_type: v4::codegen::CalRelativeDurationType; + CREATE REQUIRED PROPERTY rp_cal_relative_duration: cal::relative_duration; + CREATE REQUIRED PROPERTY rp_cal_relative_duration_type: v4::codegen::CalRelativeDurationType; + }; + CREATE TYPE v4::codegen::CalPropertiesType { + CREATE MULTI LINK ml_cal_date_duration: v4::codegen::CalDateDurationPropertiesType; + CREATE LINK ol_cal_date_duration: v4::codegen::CalDateDurationPropertiesType; + CREATE REQUIRED LINK rl_cal_date_duration: v4::codegen::CalDateDurationPropertiesType; + CREATE MULTI LINK ml_cal_local_date: v4::codegen::CalLocalDatePropertiesType; + CREATE LINK ol_cal_local_date: v4::codegen::CalLocalDatePropertiesType; + CREATE REQUIRED LINK rl_cal_local_date: v4::codegen::CalLocalDatePropertiesType; + CREATE MULTI LINK ml_cal_local_datetime: v4::codegen::CalLocalDatetimePropertiesType; + CREATE LINK ol_cal_local_datetime: v4::codegen::CalLocalDatetimePropertiesType; + CREATE REQUIRED LINK rl_cal_local_datetime: v4::codegen::CalLocalDatetimePropertiesType; + CREATE MULTI LINK ml_cal_local_time: v4::codegen::CalLocalTimePropertiesType; + CREATE LINK ol_cal_local_time: v4::codegen::CalLocalTimePropertiesType; + CREATE REQUIRED LINK rl_cal_local_time: v4::codegen::CalLocalTimePropertiesType; + CREATE MULTI LINK ml_cal_relative_duration: v4::codegen::CalRelativeDurationPropertiesType; + CREATE LINK ol_cal_relative_duration: v4::codegen::CalRelativeDurationPropertiesType; + CREATE REQUIRED LINK rl_cal_relative_duration: v4::codegen::CalRelativeDurationPropertiesType; + }; + CREATE SCALAR TYPE v4::codegen::DatetimeType EXTENDING std::datetime; + CREATE TYPE v4::codegen::DatetimePropertiesType { + CREATE MULTI PROPERTY mp_datetime: std::datetime; + CREATE MULTI PROPERTY mp_datetime_type: v4::codegen::DatetimeType; + CREATE PROPERTY op_datetime: std::datetime; + CREATE PROPERTY op_datetime_type: v4::codegen::DatetimeType; + CREATE REQUIRED PROPERTY rp_datetime: std::datetime; + CREATE REQUIRED PROPERTY rp_datetime_type: v4::codegen::DatetimeType; + }; + CREATE SCALAR TYPE v4::codegen::DurationType EXTENDING std::duration; + CREATE TYPE v4::codegen::DurationPropertiesType { + CREATE MULTI PROPERTY mp_duration: std::duration; + CREATE MULTI PROPERTY mp_duration_type: v4::codegen::DurationType; + CREATE PROPERTY op_duration: std::duration; + CREATE PROPERTY op_duration_type: v4::codegen::DurationType; + CREATE REQUIRED PROPERTY rp_duration: std::duration; + CREATE REQUIRED PROPERTY rp_duration_type: v4::codegen::DurationType; + }; + CREATE TYPE v4::codegen::DateAndTimePropertiesType { + CREATE MULTI LINK ml_cal: v4::codegen::CalPropertiesType; + CREATE LINK ol_cal: v4::codegen::CalPropertiesType; + CREATE REQUIRED LINK rl_cal: v4::codegen::CalPropertiesType; + CREATE MULTI LINK ml_datetime: v4::codegen::DatetimePropertiesType; + CREATE MULTI LINK ml_duration: v4::codegen::DurationPropertiesType; + CREATE LINK ol_datetime: v4::codegen::DatetimePropertiesType; + CREATE LINK ol_duration: v4::codegen::DurationPropertiesType; + CREATE REQUIRED LINK rl_datetime: v4::codegen::DatetimePropertiesType; + CREATE REQUIRED LINK rl_duration: v4::codegen::DurationPropertiesType; + }; + CREATE SCALAR TYPE v4::codegen::EnumType EXTENDING enum; + CREATE TYPE v4::codegen::EnumPropertiesType { + CREATE MULTI PROPERTY mp_enum_type: v4::codegen::EnumType; + CREATE PROPERTY op_enum_type: v4::codegen::EnumType; + CREATE REQUIRED PROPERTY rp_enum_type: v4::codegen::EnumType; + }; + CREATE SCALAR TYPE v4::codegen::JsonType EXTENDING std::json; + CREATE TYPE v4::codegen::JsonPropertiesType { + CREATE MULTI PROPERTY mp_json: std::json; + CREATE MULTI PROPERTY mp_json_type: v4::codegen::JsonType; + CREATE PROPERTY op_json: std::json; + CREATE PROPERTY op_json_type: v4::codegen::JsonType; + CREATE REQUIRED PROPERTY rp_json: std::json; + CREATE REQUIRED PROPERTY rp_json_type: v4::codegen::JsonType; + }; + CREATE SCALAR TYPE v4::codegen::BigintType EXTENDING std::bigint; + CREATE TYPE v4::codegen::BigintPropertiesType { + CREATE MULTI PROPERTY mp_bigint: std::bigint; + CREATE MULTI PROPERTY mp_bigint_type: v4::codegen::BigintType; + CREATE PROPERTY op_bigint: std::bigint; + CREATE PROPERTY op_bigint_type: v4::codegen::BigintType; + CREATE REQUIRED PROPERTY rp_bigint: std::bigint; + CREATE REQUIRED PROPERTY rp_bigint_type: v4::codegen::BigintType; + }; + CREATE SCALAR TYPE v4::codegen::DecimalType EXTENDING std::decimal; + CREATE TYPE v4::codegen::DecimalPropertiesType { + CREATE MULTI PROPERTY mp_decimal: std::decimal; + CREATE MULTI PROPERTY mp_decimal_type: v4::codegen::DecimalType; + CREATE PROPERTY op_decimal: std::decimal; + CREATE PROPERTY op_decimal_type: v4::codegen::DecimalType; + CREATE REQUIRED PROPERTY rp_decimal: std::decimal; + CREATE REQUIRED PROPERTY rp_decimal_type: v4::codegen::DecimalType; + }; + CREATE SCALAR TYPE v4::codegen::Float32Type EXTENDING std::float32; + CREATE TYPE v4::codegen::Float32PropertiesType { + CREATE MULTI PROPERTY mp_float32: std::float32; + CREATE MULTI PROPERTY mp_float32_type: v4::codegen::Float32Type; + CREATE PROPERTY op_float32: std::float32; + CREATE PROPERTY op_float32_type: v4::codegen::Float32Type; + CREATE REQUIRED PROPERTY rp_float32: std::float32; + CREATE REQUIRED PROPERTY rp_float32_type: v4::codegen::Float32Type; + }; + CREATE SCALAR TYPE v4::codegen::Float64Type EXTENDING std::float64; + CREATE TYPE v4::codegen::Float64PropertiesType { + CREATE MULTI PROPERTY mp_float64: std::float64; + CREATE MULTI PROPERTY mp_float64_type: v4::codegen::Float64Type; + CREATE PROPERTY op_float64: std::float64; + CREATE PROPERTY op_float64_type: v4::codegen::Float64Type; + CREATE REQUIRED PROPERTY rp_float64: std::float64; + CREATE REQUIRED PROPERTY rp_float64_type: v4::codegen::Float64Type; + }; + CREATE SCALAR TYPE v4::codegen::Int16Type EXTENDING std::int16; + CREATE TYPE v4::codegen::Int16PropertiesType { + CREATE MULTI PROPERTY mp_int16: std::int16; + CREATE MULTI PROPERTY mp_int16_type: v4::codegen::Int16Type; + CREATE PROPERTY op_int16: std::int16; + CREATE PROPERTY op_int16_type: v4::codegen::Int16Type; + CREATE REQUIRED PROPERTY rp_int16: std::int16; + CREATE REQUIRED PROPERTY rp_int16_type: v4::codegen::Int16Type; + }; + CREATE SCALAR TYPE v4::codegen::Int32Type EXTENDING std::int32; + CREATE TYPE v4::codegen::Int32PropertiesType { + CREATE MULTI PROPERTY mp_int32: std::int32; + CREATE MULTI PROPERTY mp_int32_type: v4::codegen::Int32Type; + CREATE PROPERTY op_int32: std::int32; + CREATE PROPERTY op_int32_type: v4::codegen::Int32Type; + CREATE REQUIRED PROPERTY rp_int32: std::int32; + CREATE REQUIRED PROPERTY rp_int32_type: v4::codegen::Int32Type; + }; + CREATE SCALAR TYPE v4::codegen::Int64Type EXTENDING std::int64; + CREATE TYPE v4::codegen::Int64PropertiesType { + CREATE MULTI PROPERTY mp_int64: std::int64; + CREATE MULTI PROPERTY mp_int64_type: v4::codegen::Int64Type; + CREATE PROPERTY op_int64: std::int64; + CREATE PROPERTY op_int64_type: v4::codegen::Int64Type; + CREATE REQUIRED PROPERTY rp_int64: std::int64; + CREATE REQUIRED PROPERTY rp_int64_type: v4::codegen::Int64Type; + }; + CREATE TYPE v4::codegen::NumberPropertiesType { + CREATE MULTI LINK ml_bigint: v4::codegen::BigintPropertiesType; + CREATE LINK ol_bigint: v4::codegen::BigintPropertiesType; + CREATE REQUIRED LINK rl_bigint: v4::codegen::BigintPropertiesType; + CREATE MULTI LINK ml_decimal: v4::codegen::DecimalPropertiesType; + CREATE LINK ol_decimal: v4::codegen::DecimalPropertiesType; + CREATE REQUIRED LINK rl_decimal: v4::codegen::DecimalPropertiesType; + CREATE MULTI LINK ml_float32: v4::codegen::Float32PropertiesType; + CREATE LINK ol_float32: v4::codegen::Float32PropertiesType; + CREATE REQUIRED LINK rl_float32: v4::codegen::Float32PropertiesType; + CREATE MULTI LINK ml_float64: v4::codegen::Float64PropertiesType; + CREATE LINK ol_float64: v4::codegen::Float64PropertiesType; + CREATE REQUIRED LINK rl_float64: v4::codegen::Float64PropertiesType; + CREATE MULTI LINK ml_int16: v4::codegen::Int16PropertiesType; + CREATE LINK ol_int16: v4::codegen::Int16PropertiesType; + CREATE REQUIRED LINK rl_int16: v4::codegen::Int16PropertiesType; + CREATE MULTI LINK ml_int32: v4::codegen::Int32PropertiesType; + CREATE LINK ol_int32: v4::codegen::Int32PropertiesType; + CREATE REQUIRED LINK rl_int32: v4::codegen::Int32PropertiesType; + CREATE MULTI LINK ml_int64: v4::codegen::Int64PropertiesType; + CREATE LINK ol_int64: v4::codegen::Int64PropertiesType; + CREATE REQUIRED LINK rl_int64: v4::codegen::Int64PropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeCalLocalDatePropertiesType { + CREATE MULTI PROPERTY mp_multirange_cal_local_date: multirange; + CREATE PROPERTY op_multirange_cal_local_date: multirange; + CREATE REQUIRED PROPERTY rp_multirange_cal_local_date: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeCalLocalDatePropertiesType { + CREATE MULTI PROPERTY mp_range_cal_local_date: range; + CREATE PROPERTY op_range_cal_local_date: range; + CREATE REQUIRED PROPERTY rp_range_cal_local_date: range; + }; + CREATE TYPE v4::codegen::RangeCalLocalDatePropertiesType { + CREATE MULTI LINK ml_multi_range_cal_local_date: v4::codegen::MultiRangeCalLocalDatePropertiesType; + CREATE LINK ol_multi_range_cal_local_date: v4::codegen::MultiRangeCalLocalDatePropertiesType; + CREATE REQUIRED LINK rl_multi_range_cal_local_date: v4::codegen::MultiRangeCalLocalDatePropertiesType; + CREATE MULTI LINK ml_single_range_cal_local_date: v4::codegen::SingleRangeCalLocalDatePropertiesType; + CREATE LINK ol_single_range_cal_local_date: v4::codegen::SingleRangeCalLocalDatePropertiesType; + CREATE REQUIRED LINK rl_single_range_cal_local_date: v4::codegen::SingleRangeCalLocalDatePropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeCalLocalDatetimePropertiesType { + CREATE MULTI PROPERTY mp_multirange_cal_local_datetime: multirange; + CREATE PROPERTY op_multirange_cal_local_datetime: multirange; + CREATE REQUIRED PROPERTY rp_multirange_cal_local_datetime: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeCalLocalDatetimePropertiesType { + CREATE MULTI PROPERTY mp_range_cal_local_datetime: range; + CREATE PROPERTY op_range_cal_local_datetime: range; + CREATE REQUIRED PROPERTY rp_range_cal_local_datetime: range; + }; + CREATE TYPE v4::codegen::RangeCalLocalDatetimePropertiesType { + CREATE MULTI LINK ml_multi_range_cal_local_datetime: v4::codegen::MultiRangeCalLocalDatetimePropertiesType; + CREATE LINK ol_multi_range_cal_local_datetime: v4::codegen::MultiRangeCalLocalDatetimePropertiesType; + CREATE REQUIRED LINK rl_multi_range_cal_local_datetime: v4::codegen::MultiRangeCalLocalDatetimePropertiesType; + CREATE MULTI LINK ml_single_range_cal_local_datetime: v4::codegen::SingleRangeCalLocalDatetimePropertiesType; + CREATE LINK ol_single_range_cal_local_datetime: v4::codegen::SingleRangeCalLocalDatetimePropertiesType; + CREATE REQUIRED LINK rl_single_range_cal_local_datetime: v4::codegen::SingleRangeCalLocalDatetimePropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeDatetimePropertiesType { + CREATE MULTI PROPERTY mp_multirange_datetime: multirange; + CREATE PROPERTY op_multirange_datetime: multirange; + CREATE REQUIRED PROPERTY rp_multirange_datetime: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeDatetimePropertiesType { + CREATE MULTI PROPERTY mp_range_datetime: range; + CREATE PROPERTY op_range_datetime: range; + CREATE REQUIRED PROPERTY rp_range_datetime: range; + }; + CREATE TYPE v4::codegen::RangeDatetimePropertiesType { + CREATE MULTI LINK ml_multi_range_datetime: v4::codegen::MultiRangeDatetimePropertiesType; + CREATE LINK ol_multi_range_datetime: v4::codegen::MultiRangeDatetimePropertiesType; + CREATE REQUIRED LINK rl_multi_range_datetime: v4::codegen::MultiRangeDatetimePropertiesType; + CREATE MULTI LINK ml_single_range_datetime: v4::codegen::SingleRangeDatetimePropertiesType; + CREATE LINK ol_single_range_datetime: v4::codegen::SingleRangeDatetimePropertiesType; + CREATE REQUIRED LINK rl_single_range_datetime: v4::codegen::SingleRangeDatetimePropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeDecimalPropertiesType { + CREATE MULTI PROPERTY mp_multirange_decimal: multirange; + CREATE PROPERTY op_multirange_decimal: multirange; + CREATE REQUIRED PROPERTY rp_multirange_decimal: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeDecimalPropertiesType { + CREATE MULTI PROPERTY mp_range_decimal: range; + CREATE PROPERTY op_range_decimal: range; + CREATE REQUIRED PROPERTY rp_range_decimal: range; + }; + CREATE TYPE v4::codegen::RangeDecimalPropertiesType { + CREATE MULTI LINK ml_multi_range_decimal: v4::codegen::MultiRangeDecimalPropertiesType; + CREATE LINK ol_multi_range_decimal: v4::codegen::MultiRangeDecimalPropertiesType; + CREATE REQUIRED LINK rl_multi_range_decimal: v4::codegen::MultiRangeDecimalPropertiesType; + CREATE MULTI LINK ml_single_range_decimal: v4::codegen::SingleRangeDecimalPropertiesType; + CREATE LINK ol_single_range_decimal: v4::codegen::SingleRangeDecimalPropertiesType; + CREATE REQUIRED LINK rl_single_range_decimal: v4::codegen::SingleRangeDecimalPropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeFloat32PropertiesType { + CREATE MULTI PROPERTY mp_multirange_float32: multirange; + CREATE PROPERTY op_multirange_float32: multirange; + CREATE REQUIRED PROPERTY rp_multirange_float32: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeFloat32PropertiesType { + CREATE MULTI PROPERTY mp_range_float32: range; + CREATE PROPERTY op_range_float32: range; + CREATE REQUIRED PROPERTY rp_range_float32: range; + }; + CREATE TYPE v4::codegen::RangeFloat32PropertiesType { + CREATE MULTI LINK ml_multi_range_float32: v4::codegen::MultiRangeFloat32PropertiesType; + CREATE LINK ol_multi_range_float32: v4::codegen::MultiRangeFloat32PropertiesType; + CREATE REQUIRED LINK rl_multi_range_float32: v4::codegen::MultiRangeFloat32PropertiesType; + CREATE MULTI LINK ml_single_range_float32: v4::codegen::SingleRangeFloat32PropertiesType; + CREATE LINK ol_single_range_float32: v4::codegen::SingleRangeFloat32PropertiesType; + CREATE REQUIRED LINK rl_single_range_float32: v4::codegen::SingleRangeFloat32PropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeFloat64PropertiesType { + CREATE MULTI PROPERTY mp_multirange_float64: multirange; + CREATE PROPERTY op_multirange_float64: multirange; + CREATE REQUIRED PROPERTY rp_multirange_float64: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeFloat64PropertiesType { + CREATE MULTI PROPERTY mp_range_float64: range; + CREATE PROPERTY op_range_float64: range; + CREATE REQUIRED PROPERTY rp_range_float64: range; + }; + CREATE TYPE v4::codegen::RangeFloat64PropertiesType { + CREATE MULTI LINK ml_multi_range_float64: v4::codegen::MultiRangeFloat64PropertiesType; + CREATE LINK ol_multi_range_float64: v4::codegen::MultiRangeFloat64PropertiesType; + CREATE REQUIRED LINK rl_multi_range_float64: v4::codegen::MultiRangeFloat64PropertiesType; + CREATE MULTI LINK ml_single_range_float64: v4::codegen::SingleRangeFloat64PropertiesType; + CREATE LINK ol_single_range_float64: v4::codegen::SingleRangeFloat64PropertiesType; + CREATE REQUIRED LINK rl_single_range_float64: v4::codegen::SingleRangeFloat64PropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeInt32PropertiesType { + CREATE MULTI PROPERTY mp_multi_range_int32: multirange; + CREATE PROPERTY op_multi_range_int32: multirange; + CREATE REQUIRED PROPERTY rp_multi_range_int32: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeInt32PropertiesType { + CREATE MULTI PROPERTY mp_range_int32: range; + CREATE PROPERTY op_range_int32: range; + CREATE REQUIRED PROPERTY rp_range_int32: range; + }; + CREATE TYPE v4::codegen::RangeInt32PropertiesType { + CREATE MULTI LINK ml_multi_range_int32: v4::codegen::MultiRangeInt32PropertiesType; + CREATE LINK ol_multi_range_int32: v4::codegen::MultiRangeInt32PropertiesType; + CREATE REQUIRED LINK rl_multi_range_int32: v4::codegen::MultiRangeInt32PropertiesType; + CREATE MULTI LINK ml_single_range_int32: v4::codegen::SingleRangeInt32PropertiesType; + CREATE LINK ol_single_range_int32: v4::codegen::SingleRangeInt32PropertiesType; + CREATE REQUIRED LINK rl_single_range_int32: v4::codegen::SingleRangeInt32PropertiesType; + }; + CREATE TYPE v4::codegen::MultiRangeInt64PropertiesType { + CREATE MULTI PROPERTY mp_multi_range_int64: multirange; + CREATE PROPERTY op_multi_range_int64: multirange; + CREATE REQUIRED PROPERTY rp_multi_range_int64: multirange; + }; + CREATE TYPE v4::codegen::SingleRangeInt64PropertiesType { + CREATE MULTI PROPERTY mp_range_int64: range; + CREATE PROPERTY op_range_int64: range; + CREATE REQUIRED PROPERTY rp_range_int64: range; + }; + CREATE TYPE v4::codegen::RangeInt64PropertiesType { + CREATE MULTI LINK ml_multi_range_int64: v4::codegen::MultiRangeInt64PropertiesType; + CREATE LINK ol_multi_range_int64: v4::codegen::MultiRangeInt64PropertiesType; + CREATE REQUIRED LINK rl_multi_range_int64: v4::codegen::MultiRangeInt64PropertiesType; + CREATE MULTI LINK ml_single_range_int64: v4::codegen::SingleRangeInt64PropertiesType; + CREATE LINK ol_single_range_int64: v4::codegen::SingleRangeInt64PropertiesType; + CREATE REQUIRED LINK rl_single_range_int64: v4::codegen::SingleRangeInt64PropertiesType; + }; + CREATE TYPE v4::codegen::RangePropertiesType { + CREATE MULTI LINK ml_range_cal_local_date: v4::codegen::RangeCalLocalDatePropertiesType; + CREATE LINK ol_range_cal_local_date: v4::codegen::RangeCalLocalDatePropertiesType; + CREATE REQUIRED LINK rl_range_cal_local_date: v4::codegen::RangeCalLocalDatePropertiesType; + CREATE MULTI LINK ml_range_cal_local_datetime: v4::codegen::RangeCalLocalDatetimePropertiesType; + CREATE LINK ol_range_cal_local_datetime: v4::codegen::RangeCalLocalDatetimePropertiesType; + CREATE REQUIRED LINK rl_range_cal_local_datetime: v4::codegen::RangeCalLocalDatetimePropertiesType; + CREATE MULTI LINK ml_range_datetime: v4::codegen::RangeDatetimePropertiesType; + CREATE LINK ol_range_datetime: v4::codegen::RangeDatetimePropertiesType; + CREATE REQUIRED LINK rl_range_datetime: v4::codegen::RangeDatetimePropertiesType; + CREATE MULTI LINK ml_range_decimal: v4::codegen::RangeDecimalPropertiesType; + CREATE LINK ol_range_decimal: v4::codegen::RangeDecimalPropertiesType; + CREATE REQUIRED LINK rl_range_decimal: v4::codegen::RangeDecimalPropertiesType; + CREATE MULTI LINK ml_range_float32: v4::codegen::RangeFloat32PropertiesType; + CREATE LINK ol_range_float32: v4::codegen::RangeFloat32PropertiesType; + CREATE REQUIRED LINK rl_range_float32: v4::codegen::RangeFloat32PropertiesType; + CREATE MULTI LINK ml_range_float64: v4::codegen::RangeFloat64PropertiesType; + CREATE LINK ol_range_float64: v4::codegen::RangeFloat64PropertiesType; + CREATE REQUIRED LINK rl_range_float64: v4::codegen::RangeFloat64PropertiesType; + CREATE MULTI LINK ml_range_int32: v4::codegen::RangeInt32PropertiesType; + CREATE LINK ol_range_int32: v4::codegen::RangeInt32PropertiesType; + CREATE REQUIRED LINK rl_range_int32: v4::codegen::RangeInt32PropertiesType; + CREATE MULTI LINK ml_range_int64: v4::codegen::RangeInt64PropertiesType; + CREATE LINK ol_range_int64: v4::codegen::RangeInt64PropertiesType; + CREATE REQUIRED LINK rl_range_int64: v4::codegen::RangeInt64PropertiesType; + }; + CREATE SCALAR TYPE v4::codegen::SequenceType EXTENDING std::sequence; + CREATE TYPE v4::codegen::SequencePropertiesType { + CREATE MULTI PROPERTY mp_sequence_type: v4::codegen::SequenceType; + CREATE PROPERTY op_sequence_type: v4::codegen::SequenceType; + CREATE REQUIRED PROPERTY rp_sequence_type: v4::codegen::SequenceType; + }; + CREATE SCALAR TYPE v4::codegen::StrType EXTENDING std::str; + CREATE TYPE v4::codegen::StrPropertiesType { + CREATE MULTI PROPERTY mp_str: std::str; + CREATE MULTI PROPERTY mp_str_type: v4::codegen::StrType; + CREATE PROPERTY op_str: std::str; + CREATE PROPERTY op_str_type: v4::codegen::StrType; + CREATE REQUIRED PROPERTY rp_str: std::str; + CREATE REQUIRED PROPERTY rp_str_type: v4::codegen::StrType; + }; + CREATE TYPE v4::codegen::NamedTuplePropertiesType { + CREATE MULTI PROPERTY mp_named_tuple: tuple>; + CREATE PROPERTY op_named_tuple: tuple>; + CREATE REQUIRED PROPERTY rp_named_tuple: tuple>; + }; + CREATE TYPE v4::codegen::UnnamedTuplePropertiesType { + CREATE MULTI PROPERTY mp_unnamed_tuple: tuple>; + CREATE PROPERTY op_unnamed_tuple: tuple>; + CREATE REQUIRED PROPERTY rp_unnamed_tuple: tuple>; + }; + CREATE TYPE v4::codegen::TuplePropertiesType { + CREATE MULTI LINK ml_named_tuple: v4::codegen::NamedTuplePropertiesType; + CREATE LINK ol_named_tuple: v4::codegen::NamedTuplePropertiesType; + CREATE REQUIRED LINK rl_named_tuple: v4::codegen::NamedTuplePropertiesType; + CREATE MULTI LINK ml_unnamed_tuple: v4::codegen::UnnamedTuplePropertiesType; + CREATE LINK ol_unnamed_tuple: v4::codegen::UnnamedTuplePropertiesType; + CREATE REQUIRED LINK rl_unnamed_tuple: v4::codegen::UnnamedTuplePropertiesType; + }; + CREATE SCALAR TYPE v4::codegen::UuidType EXTENDING std::uuid; + CREATE TYPE v4::codegen::UuidPropertiesType { + CREATE MULTI PROPERTY mp_uuid: std::uuid; + CREATE MULTI PROPERTY mp_uuid_type: v4::codegen::UuidType; + CREATE PROPERTY op_uuid: std::uuid; + CREATE PROPERTY op_uuid_type: v4::codegen::UuidType; + CREATE REQUIRED PROPERTY rp_uuid: std::uuid; + CREATE REQUIRED PROPERTY rp_uuid_type: v4::codegen::UuidType; + }; + CREATE SCALAR TYPE v4::codegen::VectorType EXTENDING ext::pgvector::vector<1>; + CREATE TYPE v4::codegen::VectorPropertiesType { + CREATE MULTI PROPERTY mp_vector_type: v4::codegen::VectorType; + CREATE PROPERTY op_vector_type: v4::codegen::VectorType; + CREATE REQUIRED PROPERTY rp_vector_type: v4::codegen::VectorType; + }; + CREATE TYPE v4::codegen::Aggregate { + CREATE MULTI LINK ml_array: v4::codegen::ArrayPropertiesType; + CREATE MULTI LINK ml_bool: v4::codegen::BoolPropertiesType; + CREATE MULTI LINK ml_cfg: v4::codegen::CfgPropertiesType; + CREATE MULTI LINK ml_date_and_time: v4::codegen::DateAndTimePropertiesType; + CREATE MULTI LINK ml_enum: v4::codegen::EnumPropertiesType; + CREATE MULTI LINK ml_json: v4::codegen::JsonPropertiesType; + CREATE MULTI LINK ml_number: v4::codegen::NumberPropertiesType; + CREATE MULTI LINK ml_range: v4::codegen::RangePropertiesType; + CREATE MULTI LINK ml_sequence: v4::codegen::SequencePropertiesType; + CREATE MULTI LINK ml_str: v4::codegen::StrPropertiesType; + CREATE MULTI LINK ml_tuple: v4::codegen::TuplePropertiesType; + CREATE MULTI LINK ml_uuid: v4::codegen::UuidPropertiesType; + CREATE MULTI LINK ml_vector: v4::codegen::VectorPropertiesType; + CREATE LINK ol_array: v4::codegen::ArrayPropertiesType; + CREATE LINK ol_bool: v4::codegen::BoolPropertiesType; + CREATE LINK ol_cfg: v4::codegen::CfgPropertiesType; + CREATE LINK ol_date_and_time: v4::codegen::DateAndTimePropertiesType; + CREATE LINK ol_enum: v4::codegen::EnumPropertiesType; + CREATE LINK ol_json: v4::codegen::JsonPropertiesType; + CREATE LINK ol_number: v4::codegen::NumberPropertiesType; + CREATE LINK ol_range: v4::codegen::RangePropertiesType; + CREATE LINK ol_sequence: v4::codegen::SequencePropertiesType; + CREATE LINK ol_str: v4::codegen::StrPropertiesType; + CREATE LINK ol_tuple: v4::codegen::TuplePropertiesType; + CREATE LINK ol_uuid: v4::codegen::UuidPropertiesType; + CREATE LINK ol_vector: v4::codegen::VectorPropertiesType; + CREATE REQUIRED LINK rl_array: v4::codegen::ArrayPropertiesType; + CREATE REQUIRED LINK rl_bool: v4::codegen::BoolPropertiesType; + CREATE REQUIRED LINK rl_cfg: v4::codegen::CfgPropertiesType; + CREATE REQUIRED LINK rl_date_and_time: v4::codegen::DateAndTimePropertiesType; + CREATE REQUIRED LINK rl_enum: v4::codegen::EnumPropertiesType; + CREATE REQUIRED LINK rl_json: v4::codegen::JsonPropertiesType; + CREATE REQUIRED LINK rl_number: v4::codegen::NumberPropertiesType; + CREATE REQUIRED LINK rl_range: v4::codegen::RangePropertiesType; + CREATE REQUIRED LINK rl_sequence: v4::codegen::SequencePropertiesType; + CREATE REQUIRED LINK rl_str: v4::codegen::StrPropertiesType; + CREATE REQUIRED LINK rl_tuple: v4::codegen::TuplePropertiesType; + CREATE REQUIRED LINK rl_uuid: v4::codegen::UuidPropertiesType; + CREATE REQUIRED LINK rl_vector: v4::codegen::VectorPropertiesType; + }; + CREATE SCALAR TYPE v4::codegen::BytesType EXTENDING std::bytes; +}; diff --git a/priv/edgedb/schema/v1.esdl b/test/support/schema/v1.esdl similarity index 100% rename from priv/edgedb/schema/v1.esdl rename to test/support/schema/v1.esdl diff --git a/priv/edgedb/schema/v2.esdl b/test/support/schema/v2.esdl similarity index 100% rename from priv/edgedb/schema/v2.esdl rename to test/support/schema/v2.esdl diff --git a/priv/edgedb/schema/v3.esdl b/test/support/schema/v3.esdl similarity index 100% rename from priv/edgedb/schema/v3.esdl rename to test/support/schema/v3.esdl diff --git a/priv/edgedb/schema/v4.esdl b/test/support/schema/v4.esdl similarity index 100% rename from priv/edgedb/schema/v4.esdl rename to test/support/schema/v4.esdl diff --git a/test/support/schema/v4_codegen.esdl b/test/support/schema/v4_codegen.esdl new file mode 100644 index 00000000..325ab3ed --- /dev/null +++ b/test/support/schema/v4_codegen.esdl @@ -0,0 +1,610 @@ +using extension pgvector; + +module v4::codegen { + # enum + + scalar type EnumType extending enum; + + # sequence + + scalar type SequenceType extending sequence; + + # vector + + scalar type VectorType extending ext::pgvector::vector<1>; + + # custom scalars + + scalar type StrType extending str; + scalar type BoolType extending bool; + scalar type Int16Type extending int16; + scalar type Int32Type extending int32; + scalar type Int64Type extending int64; + scalar type Float32Type extending float32; + scalar type Float64Type extending float64; + scalar type BigintType extending bigint; + scalar type DecimalType extending decimal; + scalar type JsonType extending json; + scalar type UuidType extending uuid; + scalar type BytesType extending bytes; + scalar type DatetimeType extending datetime; + scalar type DurationType extending duration; + scalar type CalLocalDatetimeType extending cal::local_datetime; + scalar type CalLocalDateType extending cal::local_date; + scalar type CalLocalTimeType extending cal::local_time; + scalar type CalRelativeDurationType extending cal::relative_duration; + scalar type CalDateDurationType extending cal::date_duration; + scalar type CfgMemoryType extending cfg::memory; + + type StrPropertiesType { + required rp_str: str; + op_str: str; + multi mp_str: str; + + required rp_str_type: StrType; + op_str_type: StrType; + multi mp_str_type: StrType; + } + + type BoolPropertiesType { + required rp_bool: bool; + op_bool: bool; + multi mp_bool: bool; + + required rp_bool_type: BoolType; + op_bool_type: BoolType; + multi mp_bool_type: BoolType; + } + + type NumberPropertiesType { + required rl_int16: Int16PropertiesType; + ol_int16: Int16PropertiesType; + multi ml_int16: Int16PropertiesType; + + required rl_int32: Int32PropertiesType; + ol_int32: Int32PropertiesType; + multi ml_int32: Int32PropertiesType; + + required rl_int64: Int64PropertiesType; + ol_int64: Int64PropertiesType; + multi ml_int64: Int64PropertiesType; + + required rl_float32: Float32PropertiesType; + ol_float32: Float32PropertiesType; + multi ml_float32: Float32PropertiesType; + + required rl_float64: Float64PropertiesType; + ol_float64: Float64PropertiesType; + multi ml_float64: Float64PropertiesType; + + required rl_decimal: DecimalPropertiesType; + ol_decimal: DecimalPropertiesType; + multi ml_decimal: DecimalPropertiesType; + + required rl_bigint: BigintPropertiesType; + ol_bigint: BigintPropertiesType; + multi ml_bigint: BigintPropertiesType; + } + + type Int16PropertiesType { + required rp_int16: int16; + op_int16: int16; + multi mp_int16: int16; + + required rp_int16_type: Int16Type; + op_int16_type: Int16Type; + multi mp_int16_type: Int16Type; + } + + type Int32PropertiesType { + required rp_int32: int32; + op_int32: int32; + multi mp_int32: int32; + + required rp_int32_type: Int32Type; + op_int32_type: Int32Type; + multi mp_int32_type: Int32Type; + } + + type Int64PropertiesType { + required rp_int64: int64; + op_int64: int64; + multi mp_int64: int64; + + required rp_int64_type: Int64Type; + op_int64_type: Int64Type; + multi mp_int64_type: Int64Type; + } + + type Float32PropertiesType { + required rp_float32: float32; + op_float32: float32; + multi mp_float32: float32; + + required rp_float32_type: Float32Type; + op_float32_type: Float32Type; + multi mp_float32_type: Float32Type; + } + + type Float64PropertiesType { + required rp_float64: float64; + op_float64: float64; + multi mp_float64: float64; + + required rp_float64_type: Float64Type; + op_float64_type: Float64Type; + multi mp_float64_type: Float64Type; + } + + type DecimalPropertiesType { + required rp_decimal: decimal; + op_decimal: decimal; + multi mp_decimal: decimal; + + required rp_decimal_type: DecimalType; + op_decimal_type: DecimalType; + multi mp_decimal_type: DecimalType; + } + + type BigintPropertiesType { + required rp_bigint: bigint; + op_bigint: bigint; + multi mp_bigint: bigint; + + required rp_bigint_type: BigintType; + op_bigint_type: BigintType; + multi mp_bigint_type: BigintType; + } + + type JsonPropertiesType { + required rp_json: json; + op_json: json; + multi mp_json: json; + + required rp_json_type: JsonType; + op_json_type: JsonType; + multi mp_json_type: JsonType; + } + + type UuidPropertiesType { + required rp_uuid: uuid; + op_uuid: uuid; + multi mp_uuid: uuid; + + required rp_uuid_type: UuidType; + op_uuid_type: UuidType; + multi mp_uuid_type: UuidType; + } + + type DateAndTimePropertiesType { + required rl_datetime: DatetimePropertiesType; + ol_datetime: DatetimePropertiesType; + multi ml_datetime: DatetimePropertiesType; + + required rl_duration: DurationPropertiesType; + ol_duration: DurationPropertiesType; + multi ml_duration: DurationPropertiesType; + + required rl_cal: CalPropertiesType; + ol_cal: CalPropertiesType; + multi ml_cal: CalPropertiesType; + } + + type DatetimePropertiesType { + required rp_datetime: datetime; + op_datetime: datetime; + multi mp_datetime: datetime; + + required rp_datetime_type: DatetimeType; + op_datetime_type: DatetimeType; + multi mp_datetime_type: DatetimeType; + } + + type DurationPropertiesType { + required rp_duration: duration; + op_duration: duration; + multi mp_duration: duration; + + required rp_duration_type: DurationType; + op_duration_type: DurationType; + multi mp_duration_type: DurationType; + } + + type CalPropertiesType { + required rl_cal_local_datetime: CalLocalDatetimePropertiesType; + ol_cal_local_datetime: CalLocalDatetimePropertiesType; + multi ml_cal_local_datetime: CalLocalDatetimePropertiesType; + + required rl_cal_local_date: CalLocalDatePropertiesType; + ol_cal_local_date: CalLocalDatePropertiesType; + multi ml_cal_local_date: CalLocalDatePropertiesType; + + required rl_cal_local_time: CalLocalTimePropertiesType; + ol_cal_local_time: CalLocalTimePropertiesType; + multi ml_cal_local_time: CalLocalTimePropertiesType; + + required rl_cal_relative_duration: CalRelativeDurationPropertiesType; + ol_cal_relative_duration: CalRelativeDurationPropertiesType; + multi ml_cal_relative_duration: CalRelativeDurationPropertiesType; + + required rl_cal_date_duration: CalDateDurationPropertiesType; + ol_cal_date_duration: CalDateDurationPropertiesType; + multi ml_cal_date_duration: CalDateDurationPropertiesType; + } + + type CalLocalDatetimePropertiesType { + required rp_cal_local_datetime: cal::local_datetime; + op_cal_local_datetime: cal::local_datetime; + multi mp_cal_local_datetime: cal::local_datetime; + + required rp_cal_local_datetime_type: CalLocalDatetimeType; + op_cal_local_datetime_type: CalLocalDatetimeType; + multi mp_cal_local_datetime_type: CalLocalDatetimeType; + } + + type CalLocalDatePropertiesType { + required rp_cal_local_date: cal::local_date; + op_cal_local_date: cal::local_date; + multi mp_cal_local_date: cal::local_date; + + required rp_cal_local_date_type: CalLocalDateType; + op_cal_local_date_type: CalLocalDateType; + multi mp_cal_local_date_type: CalLocalDateType; + } + + type CalLocalTimePropertiesType { + required rp_cal_local_time: cal::local_time; + op_cal_local_time: cal::local_time; + multi mp_cal_local_time: cal::local_time; + + required rp_cal_local_time_type: CalLocalTimeType; + op_cal_local_time_type: CalLocalTimeType; + multi mp_cal_local_time_type: CalLocalTimeType; + } + + type CalRelativeDurationPropertiesType { + required rp_cal_relative_duration: cal::relative_duration; + op_cal_relative_duration: cal::relative_duration; + multi mp_cal_relative_duration: cal::relative_duration; + + required rp_cal_relative_duration_type: CalRelativeDurationType; + op_cal_relative_duration_type: CalRelativeDurationType; + multi mp_cal_relative_duration_type: CalRelativeDurationType; + } + + type CalDateDurationPropertiesType { + required rp_cal_date_duration: cal::date_duration; + op_cal_date_duration: cal::date_duration; + multi mp_cal_date_duration: cal::date_duration; + + required rp_cal_date_duration_type: CalDateDurationType; + op_cal_date_duration_type: CalDateDurationType; + multi mp_cal_date_duration_type: CalDateDurationType; + } + + type CfgPropertiesType { + required rl_cfg_memory: CfgMemoryPropertiesType; + ol_cfg_memory: CfgMemoryPropertiesType; + multi ml_cfg_memory: CfgMemoryPropertiesType; + } + + type CfgMemoryPropertiesType { + required rp_cfg_memory: cfg::memory; + op_cfg_memory: cfg::memory; + multi mp_cfg_memory: cfg::memory; + + required rp_cfg_memory_type: CfgMemoryType; + op_cfg_memory_type: CfgMemoryType; + multi mp_cfg_memory_type: CfgMemoryType; + } + + type SequencePropertiesType { + required rp_sequence_type: SequenceType; + op_sequence_type: SequenceType; + multi mp_sequence_type: SequenceType; + } + + type EnumPropertiesType { + required rp_enum_type: EnumType; + op_enum_type: EnumType; + multi mp_enum_type: EnumType; + } + + type VectorPropertiesType { + required rp_vector_type: VectorType; + op_vector_type: VectorType; + multi mp_vector_type: VectorType; + } + + type ArrayPropertiesType { + required rp_array: array; + op_array: array; + multi mp_array: array; + } + + type TuplePropertiesType { + required rl_unnamed_tuple: UnnamedTuplePropertiesType; + ol_unnamed_tuple: UnnamedTuplePropertiesType; + multi ml_unnamed_tuple: UnnamedTuplePropertiesType; + + required rl_named_tuple: NamedTuplePropertiesType; + ol_named_tuple: NamedTuplePropertiesType; + multi ml_named_tuple: NamedTuplePropertiesType; + } + + type UnnamedTuplePropertiesType { + required rp_unnamed_tuple: tuple>; + op_unnamed_tuple: tuple>; + multi mp_unnamed_tuple: tuple>; + } + + type NamedTuplePropertiesType { + required rp_named_tuple: tuple>; + op_named_tuple: tuple>; + multi mp_named_tuple: tuple>; + } + + type RangePropertiesType { + required rl_range_int32: RangeInt32PropertiesType; + ol_range_int32: RangeInt32PropertiesType; + multi ml_range_int32: RangeInt32PropertiesType; + + required rl_range_int64: RangeInt64PropertiesType; + ol_range_int64: RangeInt64PropertiesType; + multi ml_range_int64: RangeInt64PropertiesType; + + required rl_range_float32: RangeFloat32PropertiesType; + ol_range_float32: RangeFloat32PropertiesType; + multi ml_range_float32: RangeFloat32PropertiesType; + + required rl_range_float64: RangeFloat64PropertiesType; + ol_range_float64: RangeFloat64PropertiesType; + multi ml_range_float64: RangeFloat64PropertiesType; + + required rl_range_decimal: RangeDecimalPropertiesType; + ol_range_decimal: RangeDecimalPropertiesType; + multi ml_range_decimal: RangeDecimalPropertiesType; + + required rl_range_datetime: RangeDatetimePropertiesType; + ol_range_datetime: RangeDatetimePropertiesType; + multi ml_range_datetime: RangeDatetimePropertiesType; + + required rl_range_cal_local_datetime: RangeCalLocalDatetimePropertiesType; + ol_range_cal_local_datetime: RangeCalLocalDatetimePropertiesType; + multi ml_range_cal_local_datetime: RangeCalLocalDatetimePropertiesType; + + required rl_range_cal_local_date: RangeCalLocalDatePropertiesType; + ol_range_cal_local_date: RangeCalLocalDatePropertiesType; + multi ml_range_cal_local_date: RangeCalLocalDatePropertiesType; + } + + type RangeInt32PropertiesType { + required rl_single_range_int32: SingleRangeInt32PropertiesType; + ol_single_range_int32: SingleRangeInt32PropertiesType; + multi ml_single_range_int32: SingleRangeInt32PropertiesType; + + required rl_multi_range_int32: MultiRangeInt32PropertiesType; + ol_multi_range_int32: MultiRangeInt32PropertiesType; + multi ml_multi_range_int32: MultiRangeInt32PropertiesType; + } + + type SingleRangeInt32PropertiesType { + required rp_range_int32: range; + op_range_int32: range; + multi mp_range_int32: range; + } + + type MultiRangeInt32PropertiesType { + required rp_multi_range_int32: multirange; + op_multi_range_int32: multirange; + multi mp_multi_range_int32: multirange; + } + + type RangeInt64PropertiesType { + required rl_single_range_int64: SingleRangeInt64PropertiesType; + ol_single_range_int64: SingleRangeInt64PropertiesType; + multi ml_single_range_int64: SingleRangeInt64PropertiesType; + + required rl_multi_range_int64: MultiRangeInt64PropertiesType; + ol_multi_range_int64: MultiRangeInt64PropertiesType; + multi ml_multi_range_int64: MultiRangeInt64PropertiesType; + } + + type SingleRangeInt64PropertiesType { + required rp_range_int64: range; + op_range_int64: range; + multi mp_range_int64: range; + } + + type MultiRangeInt64PropertiesType { + required rp_multi_range_int64: multirange; + op_multi_range_int64: multirange; + multi mp_multi_range_int64: multirange; + } + + type RangeFloat32PropertiesType { + required rl_single_range_float32: SingleRangeFloat32PropertiesType; + ol_single_range_float32: SingleRangeFloat32PropertiesType; + multi ml_single_range_float32: SingleRangeFloat32PropertiesType; + + required rl_multi_range_float32: MultiRangeFloat32PropertiesType; + ol_multi_range_float32: MultiRangeFloat32PropertiesType; + multi ml_multi_range_float32: MultiRangeFloat32PropertiesType; + } + + type SingleRangeFloat32PropertiesType { + required rp_range_float32: range; + op_range_float32: range; + multi mp_range_float32: range; + } + + type MultiRangeFloat32PropertiesType { + required rp_multirange_float32: multirange; + op_multirange_float32: multirange; + multi mp_multirange_float32: multirange; + } + + type RangeFloat64PropertiesType { + required rl_single_range_float64: SingleRangeFloat64PropertiesType; + ol_single_range_float64: SingleRangeFloat64PropertiesType; + multi ml_single_range_float64: SingleRangeFloat64PropertiesType; + + required rl_multi_range_float64: MultiRangeFloat64PropertiesType; + ol_multi_range_float64: MultiRangeFloat64PropertiesType; + multi ml_multi_range_float64: MultiRangeFloat64PropertiesType; + } + + type SingleRangeFloat64PropertiesType { + required rp_range_float64: range; + op_range_float64: range; + multi mp_range_float64: range; + } + + type MultiRangeFloat64PropertiesType { + required rp_multirange_float64: multirange; + op_multirange_float64: multirange; + multi mp_multirange_float64: multirange; + } + + type RangeDecimalPropertiesType { + required rl_single_range_decimal: SingleRangeDecimalPropertiesType; + ol_single_range_decimal: SingleRangeDecimalPropertiesType; + multi ml_single_range_decimal: SingleRangeDecimalPropertiesType; + + required rl_multi_range_decimal: MultiRangeDecimalPropertiesType; + ol_multi_range_decimal: MultiRangeDecimalPropertiesType; + multi ml_multi_range_decimal: MultiRangeDecimalPropertiesType; + } + + type SingleRangeDecimalPropertiesType { + required rp_range_decimal: range; + op_range_decimal: range; + multi mp_range_decimal: range; + } + + type MultiRangeDecimalPropertiesType { + required rp_multirange_decimal: multirange; + op_multirange_decimal: multirange; + multi mp_multirange_decimal: multirange; + } + + type RangeDatetimePropertiesType { + required rl_single_range_datetime: SingleRangeDatetimePropertiesType; + ol_single_range_datetime: SingleRangeDatetimePropertiesType; + multi ml_single_range_datetime: SingleRangeDatetimePropertiesType; + + required rl_multi_range_datetime: MultiRangeDatetimePropertiesType; + ol_multi_range_datetime: MultiRangeDatetimePropertiesType; + multi ml_multi_range_datetime: MultiRangeDatetimePropertiesType; + } + + type SingleRangeDatetimePropertiesType { + required rp_range_datetime: range; + op_range_datetime: range; + multi mp_range_datetime: range; + } + + type MultiRangeDatetimePropertiesType { + required rp_multirange_datetime: multirange; + op_multirange_datetime: multirange; + multi mp_multirange_datetime: multirange; + } + + type RangeCalLocalDatetimePropertiesType { + required rl_single_range_cal_local_datetime: SingleRangeCalLocalDatetimePropertiesType; + ol_single_range_cal_local_datetime: SingleRangeCalLocalDatetimePropertiesType; + multi ml_single_range_cal_local_datetime: SingleRangeCalLocalDatetimePropertiesType; + + required rl_multi_range_cal_local_datetime: MultiRangeCalLocalDatetimePropertiesType; + ol_multi_range_cal_local_datetime: MultiRangeCalLocalDatetimePropertiesType; + multi ml_multi_range_cal_local_datetime: MultiRangeCalLocalDatetimePropertiesType; + } + + type SingleRangeCalLocalDatetimePropertiesType { + required rp_range_cal_local_datetime: range; + op_range_cal_local_datetime: range; + multi mp_range_cal_local_datetime: range; + } + + type MultiRangeCalLocalDatetimePropertiesType { + required rp_multirange_cal_local_datetime: multirange; + op_multirange_cal_local_datetime: multirange; + multi mp_multirange_cal_local_datetime: multirange; + } + + type RangeCalLocalDatePropertiesType { + required rl_single_range_cal_local_date: SingleRangeCalLocalDatePropertiesType; + ol_single_range_cal_local_date: SingleRangeCalLocalDatePropertiesType; + multi ml_single_range_cal_local_date: SingleRangeCalLocalDatePropertiesType; + + required rl_multi_range_cal_local_date: MultiRangeCalLocalDatePropertiesType; + ol_multi_range_cal_local_date: MultiRangeCalLocalDatePropertiesType; + multi ml_multi_range_cal_local_date: MultiRangeCalLocalDatePropertiesType; + } + + type SingleRangeCalLocalDatePropertiesType { + required rp_range_cal_local_date: range; + op_range_cal_local_date: range; + multi mp_range_cal_local_date: range; + } + + type MultiRangeCalLocalDatePropertiesType { + required rp_multirange_cal_local_date: multirange; + op_multirange_cal_local_date: multirange; + multi mp_multirange_cal_local_date: multirange; + } + + type Aggregate { + required rl_str: StrPropertiesType; + ol_str: StrPropertiesType; + multi ml_str: StrPropertiesType; + + required rl_bool: BoolPropertiesType; + ol_bool: BoolPropertiesType; + multi ml_bool: BoolPropertiesType; + + required rl_number: NumberPropertiesType; + ol_number: NumberPropertiesType; + multi ml_number: NumberPropertiesType; + + required rl_json: JsonPropertiesType; + ol_json: JsonPropertiesType; + multi ml_json: JsonPropertiesType; + + required rl_uuid: UuidPropertiesType; + ol_uuid: UuidPropertiesType; + multi ml_uuid: UuidPropertiesType; + + required rl_date_and_time: DateAndTimePropertiesType; + ol_date_and_time: DateAndTimePropertiesType; + multi ml_date_and_time: DateAndTimePropertiesType; + + required rl_cfg: CfgPropertiesType; + ol_cfg: CfgPropertiesType; + multi ml_cfg: CfgPropertiesType; + + required rl_sequence: SequencePropertiesType; + ol_sequence: SequencePropertiesType; + multi ml_sequence: SequencePropertiesType; + + required rl_enum: EnumPropertiesType; + ol_enum: EnumPropertiesType; + multi ml_enum: EnumPropertiesType; + + required rl_vector: VectorPropertiesType; + ol_vector: VectorPropertiesType; + multi ml_vector: VectorPropertiesType; + + required rl_array: ArrayPropertiesType; + ol_array: ArrayPropertiesType; + multi ml_array: ArrayPropertiesType; + + required rl_tuple: TuplePropertiesType; + ol_tuple: TuplePropertiesType; + multi ml_tuple: TuplePropertiesType; + + required rl_range: RangePropertiesType; + ol_range: RangePropertiesType; + multi ml_range: RangePropertiesType; + } +}; diff --git a/test/support/scripts/drop-roles.sh b/test/support/scripts/drop-roles.sh new file mode 100755 index 00000000..facdd066 --- /dev/null +++ b/test/support/scripts/drop-roles.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +edgedb query --file test/support/scripts/edgeql/drop-roles.edgeql diff --git a/priv/scripts/edgedb_docs.exs b/test/support/scripts/edgedb_docs.exs similarity index 98% rename from priv/scripts/edgedb_docs.exs rename to test/support/scripts/edgedb_docs.exs index f6f95708..335f5cd9 100644 --- a/priv/scripts/edgedb_docs.exs +++ b/test/support/scripts/edgedb_docs.exs @@ -2,6 +2,9 @@ defmodule EdgeDB.Docs do @moduledoc false @skip_pages ~w(CHANGELOG.md) + @skip_modules [ + Mix.Tasks.Edgedb.Generate + ] @error_group :Errors @api_group :API @@ -252,6 +255,9 @@ defmodule EdgeDB.Docs do {module, Code.fetch_docs(module)} end) |> Enum.filter(fn + {mod, _doc} when mod in @skip_modules -> + false + {_mod, {:docs_v1, _annotation, _lang, _format, mod_doc, _meta, _docs}} when mod_doc in [:none, :hidden] -> false diff --git a/priv/scripts/edgeql/drop-roles.edgeql b/test/support/scripts/edgeql/drop-roles.edgeql similarity index 100% rename from priv/scripts/edgeql/drop-roles.edgeql rename to test/support/scripts/edgeql/drop-roles.edgeql diff --git a/priv/scripts/edgeql/setup-roles.edgeql b/test/support/scripts/edgeql/setup-roles.edgeql similarity index 100% rename from priv/scripts/edgeql/setup-roles.edgeql rename to test/support/scripts/edgeql/setup-roles.edgeql diff --git a/test/support/scripts/setup-roles.sh b/test/support/scripts/setup-roles.sh new file mode 100755 index 00000000..59191154 --- /dev/null +++ b/test/support/scripts/setup-roles.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +edgedb query --file test/support/scripts/edgeql/setup-roles.edgeql