From 55d4c222687ffffd1e4d9dd0362c98db6685965b Mon Sep 17 00:00:00 2001 From: Quin Lynch Date: Tue, 28 May 2024 11:46:37 -0300 Subject: [PATCH] add EdgeQL global support --- src/EdgeDB.Net.QueryBuilder/EdgeQL.cs | 2 ++ .../Translators/Methods/EdgeQLMethodTranslator.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/EdgeDB.Net.QueryBuilder/Translators/Methods/EdgeQLMethodTranslator.cs diff --git a/src/EdgeDB.Net.QueryBuilder/EdgeQL.cs b/src/EdgeDB.Net.QueryBuilder/EdgeQL.cs index 1948a58c..5ed1a743 100644 --- a/src/EdgeDB.Net.QueryBuilder/EdgeQL.cs +++ b/src/EdgeDB.Net.QueryBuilder/EdgeQL.cs @@ -61,4 +61,6 @@ public static T Cube(T value) public static long Count(IQuery a) => default!; public static EdgeDBTypeContainer SchemaType() => EdgeDBTypeContainer.Create(); + + public static T Global(string name) => default!; } diff --git a/src/EdgeDB.Net.QueryBuilder/Translators/Methods/EdgeQLMethodTranslator.cs b/src/EdgeDB.Net.QueryBuilder/Translators/Methods/EdgeQLMethodTranslator.cs new file mode 100644 index 00000000..3fec5395 --- /dev/null +++ b/src/EdgeDB.Net.QueryBuilder/Translators/Methods/EdgeQLMethodTranslator.cs @@ -0,0 +1,10 @@ +namespace EdgeDB.Translators.Methods; + +internal sealed class EdgeQLMethodTranslator : MethodTranslator +{ + [MethodName(nameof(EdgeQL.Global))] + public void Global(QueryWriter writer, TranslatedParameter name) + { + writer.Append("global ", name); + } +}