-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21ba8f5
commit 3c207fd
Showing
95 changed files
with
2,528 additions
and
1,531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/Modules/DataAccess.Orm.Sql.Postgres/Translation/ColumnsChainExpressionTranslator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
namespace SpaceEngineers.Core.DataAccess.Orm.Sql.Postgres.Translation | ||
{ | ||
using System; | ||
using System.Text; | ||
using AutoRegistration.Api.Abstractions; | ||
using AutoRegistration.Api.Attributes; | ||
using AutoRegistration.Api.Enumerations; | ||
using SpaceEngineers.Core.DataAccess.Orm.Sql.Translation; | ||
using SpaceEngineers.Core.DataAccess.Orm.Sql.Translation.Expressions; | ||
|
||
[Component(EnLifestyle.Singleton)] | ||
internal class ColumnsChainExpressionTranslator : ISqlExpressionTranslator<ColumnsChainExpression>, | ||
IResolvable<ISqlExpressionTranslator<ColumnsChainExpression>>, | ||
ICollectionResolvable<ISqlExpressionTranslator> | ||
{ | ||
private readonly ISqlExpressionTranslatorComposite _translator; | ||
|
||
public ColumnsChainExpressionTranslator(ISqlExpressionTranslatorComposite translator) | ||
{ | ||
_translator = translator; | ||
} | ||
|
||
public string Translate(ISqlExpression expression, int depth) | ||
{ | ||
return expression is ColumnsChainExpression columnsChainExpression | ||
? Translate(columnsChainExpression, depth) | ||
: throw new NotSupportedException($"Unsupported sql expression type {expression.GetType()}"); | ||
} | ||
|
||
public string Translate(ColumnsChainExpression expression, int depth) | ||
{ | ||
var sb = new StringBuilder(); | ||
|
||
if (expression.Source is not ParameterExpression { SkipInSql: true }) | ||
{ | ||
sb.Append(_translator.Translate(expression.Source, depth)); | ||
sb.Append('.'); | ||
} | ||
|
||
sb.Append('"'); | ||
sb.Append(expression.Name); | ||
sb.Append('"'); | ||
|
||
return sb.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
src/Modules/DataAccess.Orm.Sql.Postgres/Translation/SetExpressionTranslator.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.