Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -1,11 +1,12 @@
// Copyright (C) 2014-2020 Xtensive LLC.
// Copyright (C) 2014-2026 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alena Mikshina
// Created: 2014.05.06

using NpgsqlTypes;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;
using Operator = Xtensive.Reflection.WellKnown.Operator;

namespace Xtensive.Orm.Providers.PostgreSql
Expand All @@ -15,49 +16,49 @@ internal class NpgsqlBoxCompilers
{
#region Extractors

[Compiler(typeof(NpgsqlBox), "UpperRight", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.UpperRight), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlBoxExtractUpperRightPoint(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 0);
}

[Compiler(typeof(NpgsqlBox), "LowerLeft", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.LowerLeft), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlBoxExtractLowerLeftPoint(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 1);
}

[Compiler(typeof(NpgsqlBox), "Right", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.Right), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractRight(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPointExtractX(PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 0));
}

[Compiler(typeof(NpgsqlBox), "Top", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.Top), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractTop(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPointExtractY(PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 0));
}

[Compiler(typeof(NpgsqlBox), "Left", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.Left), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractLeft(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPointExtractX(PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 1));
}

[Compiler(typeof(NpgsqlBox), "Bottom", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.Bottom), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractBottom(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPointExtractY(PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 1));
}

[Compiler(typeof(NpgsqlBox), "Height", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.Height), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractHeight(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlBoxExtractHeight(_this);
}

[Compiler(typeof(NpgsqlBox), "Width", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlBox), nameof(NpgsqlBox.Width), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractWidth(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlBoxExtractWidth(_this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (C) 2014-2020 Xtensive LLC.
// Copyright (C) 2014-2026 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alena Mikshina
// Created: 2014.05.06

using NpgsqlTypes;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;
using Operator = Xtensive.Reflection.WellKnown.Operator;

namespace Xtensive.Orm.Providers.PostgreSql
Expand All @@ -15,13 +16,13 @@ internal class NpgsqlCircleCompilers
{
#region Extractors

[Compiler(typeof(NpgsqlCircle), "Center", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlCircle), nameof(NpgsqlCircle.Center), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlCircleExtractCenterPoint(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlCircleExtractCenter(_this);
}

[Compiler(typeof(NpgsqlCircle), "Radius", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlCircle), nameof(NpgsqlCircle.Radius), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlCircleExtractRadius(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlCircleExtractRadius(_this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (C) 2014-2020 Xtensive LLC.
// Copyright (C) 2014-2026 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alena Mikshina
// Created: 2014.05.06

using NpgsqlTypes;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;
using Operator = Xtensive.Reflection.WellKnown.Operator;

namespace Xtensive.Orm.Providers.PostgreSql
Expand All @@ -15,13 +16,13 @@ internal static class NpgsqlLSegCompilers
{
#region Extractors

[Compiler(typeof(NpgsqlLSeg), "Start", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlLSeg), nameof(NpgsqlLSeg.Start), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlLSegExtractStartPoint(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 0);
}

[Compiler(typeof(NpgsqlLSeg), "End", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlLSeg), nameof(NpgsqlLSeg.End), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlLSegExtractEndPoint(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlTypeExtractPoint(_this, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,51 @@

using NpgsqlTypes;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;
using Operator = Xtensive.Reflection.WellKnown.Operator;

namespace Xtensive.Orm.Providers.PostgreSql
{
[CompilerContainer(typeof(SqlExpression))]
internal class NpgsqlPathCompilers
{
[Compiler(typeof(NpgsqlPath), "Count", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlPath), nameof(NpgsqlPath.Count), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPathCount(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPathAndPolygonCount(_this);
}

[Compiler(typeof(NpgsqlPath), "Open", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlPath), nameof(NpgsqlPath.Open), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPathOpen(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPathAndPolygonOpen(_this);
}

[Compiler(typeof(NpgsqlPath), "Contains", TargetKind.Method)]
[Compiler(typeof(NpgsqlPath), nameof(NpgsqlPath.Contains), TargetKind.Method)]
public static SqlExpression NpgsqlPathContains(SqlExpression _this,
[Type(typeof(NpgsqlPoint))] SqlExpression point)
{
return PostgresqlSqlDml.NpgsqlPathAndPolygonContains(_this, point);
}

#region Operators

[Compiler(typeof(NpgsqlPath), Operator.Equality, TargetKind.Operator)]
public static SqlExpression NpgsqlPathOperatorEquality(
[Type(typeof(NpgsqlPath))] SqlExpression left,
[Type(typeof(NpgsqlPath))] SqlExpression right)
{
return PostgresqlSqlDml.NpgsqlTypeOperatorEquality(left, right);
}

[Compiler(typeof(NpgsqlPath), Operator.Inequality, TargetKind.Operator)]
public static SqlExpression NpgsqlPathOperatorInequality(
[Type(typeof(NpgsqlPath))] SqlExpression left,
[Type(typeof(NpgsqlPath))] SqlExpression right)
{
return !NpgsqlPathOperatorEquality(left, right);
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (C) 2014-2020 Xtensive LLC.
// Copyright (C) 2014-2026 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alena Mikshina
// Created: 2014.05.05

using NpgsqlTypes;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;
using Operator = Xtensive.Reflection.WellKnown.Operator;

namespace Xtensive.Orm.Providers.PostgreSql
Expand All @@ -15,13 +16,13 @@ internal static class NpgsqlPointCompilers
{
#region Extractors

[Compiler(typeof(NpgsqlPoint), "X", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlPoint), nameof(NpgsqlPoint.X), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractX(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPointExtractX(_this);
}

[Compiler(typeof(NpgsqlPoint), "Y", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlPoint), nameof(NpgsqlPoint.Y), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPointExtractY(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPointExtractY(_this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
// Copyright (C) 2014-2020 Xtensive LLC.
// Copyright (C) 2014-2026 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alena Mikshina
// Created: 2014.05.06

using NpgsqlTypes;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;
using Operator = Xtensive.Reflection.WellKnown.Operator;

namespace Xtensive.Orm.Providers.PostgreSql
{
[CompilerContainer(typeof(SqlExpression))]
internal class NpgsqlPolygonCompilers
{
[Compiler(typeof(NpgsqlPolygon), "Count", TargetKind.PropertyGet)]
[Compiler(typeof(NpgsqlPolygon), nameof(NpgsqlPolygon.Count), TargetKind.PropertyGet)]
public static SqlExpression NpgsqlPolygonCount(SqlExpression _this)
{
return PostgresqlSqlDml.NpgsqlPathAndPolygonCount(_this);
}

[Compiler(typeof(NpgsqlPolygon), "Contains", TargetKind.Method)]
[Compiler(typeof(NpgsqlPolygon), nameof(NpgsqlPolygon.Contains), TargetKind.Method)]
public static SqlExpression NpgsqlPolygonContains(SqlExpression _this,
[Type(typeof(NpgsqlPoint))] SqlExpression point)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Xtensive.Reflection.PostgreSql;
using Xtensive.Sql;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;

namespace Xtensive.Orm.Providers.PostgreSql
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Xtensive.Sql;
using Xtensive.Sql.Dml;

namespace Xtensive.Orm.Providers.PostgreSql
namespace Xtensive.Sql.Dml.PostgreSql
{
/// <summary>
/// A factory for SQL DML operations for Postgresql DBMS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

using Xtensive.Sql.Dml;

namespace Xtensive.Orm.Providers.PostgreSql
namespace Xtensive.Sql.Dml.PostgreSql
{
/// <summary>
/// Contains additional provider-specific SQL functions.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
using Xtensive.Sql.Compiler;
using Xtensive.Sql.Ddl;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;
using Xtensive.Sql.Model;
using Xtensive.Sql.Drivers.PostgreSql.Resources;
using Xtensive.Orm.Providers.PostgreSql;
using SqlCompiler = Xtensive.Sql.Compiler.SqlCompiler;

namespace Xtensive.Sql.Drivers.PostgreSql.v11_0
Expand Down Expand Up @@ -789,7 +788,7 @@ public override void Visit(SqlCreateIndex node, IndexColumn item)
public override void Visit(SqlFreeTextTable node)
{
if (node.TargetColumns.Count != 1 || node.TargetColumns[0] != node.TargetTable.Asterisk) {
throw new NotSupportedException(Strings.ExFreeTextSearchOnCustomColumnsNotSupported);
throw new NotSupportedException(Resources.Strings.ExFreeTextSearchOnCustomColumnsNotSupported);
}

var fullTextIndex = node.TargetTable.DataTable.Indexes.OfType<FullTextIndex>().Single();
Expand Down
5 changes: 3 additions & 2 deletions Orm/Xtensive.Orm.PostgreSql/Xtensive.Orm.PostgreSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="Sql.Drivers.PostgreSql\Resources\Strings.resx">
<None Include="Sql\Drivers.PostgreSql\Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
<CustomToolNamespace>Xtensive.Sql.Drivers.PostgreSql.Resources</CustomToolNamespace>
</None>
<Compile Update="Sql.Drivers.PostgreSql\Resources\Strings.Designer.cs">
<Compile Update="Sql\Drivers.PostgreSql\Resources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (C) 2013 Xtensive LLC.
// All rights reserved.
// For conditions of distribution and use, see license.
// Copyright (C) 2014-2026 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alena Mikshina
// Created: 2014.05.14

using System;
using NUnit.Framework;
using Xtensive.Orm.Providers.PostgreSql;
using Xtensive.Sql;
using Xtensive.Sql.Dml;
using Xtensive.Sql.Dml.PostgreSql;

namespace Xtensive.Orm.Tests.Sql.PostgreSql
{
Expand Down
Loading