Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9ced46d
Supported Types tests no longer need to resetdbstate after each db ro…
seantleonard May 1, 2024
97b04d6
fix test input. (figure out why this wasn't failing before) i didn't …
seantleonard May 1, 2024
91f5f4c
ensure typeid in selection set for more tests so that graphql actual …
seantleonard May 2, 2024
26f4d39
Merge branch 'main' into dev/sean/improveTypeTestExecTime
seantleonard May 13, 2024
343d205
Fix MySql Supported Types tests and add new test methods which are mo…
seantleonard Jun 8, 2024
c75840f
Fix broken graphql test that was somehow showing as green but was act…
seantleonard Jun 8, 2024
8543e2c
fix localtime/time tests with bad values.
seantleonard Jun 8, 2024
bfe523d
more mssql time test fixes. removed null for LocalTime, not compatible.
seantleonard Jun 8, 2024
96f877b
Fix TestTimeTypePrecisionCheck test and fix PG single_type test with …
seantleonard Jun 13, 2024
b70baa7
Merge branch 'main' into dev/sean/improveTypeTestExecTime
seantleonard Jun 13, 2024
7fb3574
Updated DabField comments. Updated DateTime conversion to UTC comment…
seantleonard Jun 15, 2024
b304dc4
Removed commented code. Updated Single_type graphql tests to accommod…
seantleonard Jun 15, 2024
98004ac
Formatting
seantleonard Jun 15, 2024
2bf9279
fix test input
seantleonard Jun 15, 2024
6f7921b
fix test
seantleonard Jun 15, 2024
d286855
Merge branch 'main' into dev/sean/improveTypeTestExecTime
seantleonard Jun 19, 2024
674c4d7
update type -> graphqldatatype for specificity per pr feedback.
seantleonard Jun 19, 2024
5615200
Merge branch 'main' into dev/sean/improveTypeTestExecTime
seantleonard Jun 21, 2024
f090359
Merge branch 'main' into dev/sean/improveTypeTestExecTime
Aniruddh25 Jul 3, 2024
7cf8109
Update src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/DabField.cs
abhishekkumams Jul 4, 2024
8351553
Update src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/GraphQLS…
abhishekkumams Jul 4, 2024
42d77d4
Merge branch 'main' into dev/sean/improveTypeTestExecTime
abhishekkumams Jul 8, 2024
597bb0b
fixing nits
abhishekkumams Jul 9, 2024
d97cbef
test type conversion to real in postgres
abhishekkumams Jul 9, 2024
aa7aaca
fixing nits
abhishekkumams Jul 9, 2024
af9e89c
fixing nits
abhishekkumams Jul 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,14 @@ protected static object ParseParamAsSystemType(string param, Type systemType)
"Double" => double.Parse(param),
"Decimal" => decimal.Parse(param),
"Boolean" => bool.Parse(param),
"DateTime" => DateTimeOffset.Parse(param, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AssumeUniversal).DateTime,
// When GraphQL input specifies a TZ offset "12-31-2024T12:00:00+03:00"
// and DAB has resolved the ColumnDefinition.SystemType to DateTime,
// DAB converts the input to UTC because:
// - DAB assumes that values without timezone offset are UTC.
// - DAB shouldn't store values in the backend database which the user did not intend
// - e.g. Storing this value for the original example would be incorrect: "12-31-2024T12:00:00"
// - The correct value to store would be "12-31-2024T09:00:00" (UTC)
"DateTime" => DateTimeOffset.Parse(param, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AssumeUniversal).UtcDateTime,
"DateTimeOffset" => DateTimeOffset.Parse(param, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AssumeUniversal),
"Date" => DateOnly.Parse(param),
"Guid" => Guid.Parse(param),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

namespace Azure.DataApiBuilder.Service.Tests.SqlTests.GraphQLSupportedTypesTests;

/// <summary>
/// Encapsulates field name metadata which is used when
/// creating database queries to validate test results
/// in the GraphQLSupportedTypesTestBase.
/// </summary>
public class DabField
{
/// <summary>
/// Mapped (aliased) column name defined in DAB runtime config.
/// </summary>
public string Alias { get; set; }

/// <summary>
/// Database column name.
/// </summary>
public string BackingColumnName { get; set; }

/// <summary>
/// Creates a new DabField instance with both alias and backing column name.
/// </summary>
/// <param name="alias">Mapped (aliased) column name defined in DAB runtime config.</param>
/// <param name="backingColumnName">Database column name.</param>
public DabField(string alias, string backingColumnName)
{
Alias = alias;
BackingColumnName = backingColumnName;
}

/// <summary>
/// Creates a new DabField instance with only the backing column name
/// where the alias is the same as the backing column name.
/// </summary>
/// <param name="backingColumnName">Database column name.</param>
public DabField(string backingColumnName)
{
Alias = backingColumnName;
BackingColumnName = backingColumnName;
}
}
Loading