forked from npgsql/efcore.pg
-
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.
Add unaccent extension (npgsql#1501)
Closes npgsql#1530
- Loading branch information
1 parent
bc23399
commit 795cb6b
Showing
9 changed files
with
128 additions
and
5 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
2 changes: 1 addition & 1 deletion
2
src/EFCore.PG/Storage/Internal/Mapping/NpgsqlRegconfigTypeMapping.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
24 changes: 24 additions & 0 deletions
24
src/EFCore.PG/Storage/Internal/Mapping/NpgsqlRegdictionaryTypeMapping.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,24 @@ | ||
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Storage; | ||
using Npgsql.EntityFrameworkCore.PostgreSQL.Utilities; | ||
using NpgsqlTypes; | ||
|
||
namespace Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.Mapping | ||
{ | ||
public class NpgsqlRegdictionaryTypeMapping : NpgsqlTypeMapping | ||
{ | ||
public NpgsqlRegdictionaryTypeMapping() : base("regdictionary", typeof(uint), NpgsqlDbType.Oid) { } | ||
|
||
protected NpgsqlRegdictionaryTypeMapping(RelationalTypeMappingParameters parameters) | ||
: base(parameters, NpgsqlDbType.Oid) { } | ||
|
||
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) | ||
=> new NpgsqlRegdictionaryTypeMapping(parameters); | ||
|
||
protected override string GenerateNonNullSqlLiteral(object value) | ||
=> $"'{EscapeSqlLiteral((string)value)}'"; | ||
|
||
string EscapeSqlLiteral([NotNull] string literal) | ||
=> Check.NotNull(literal, nameof(literal)).Replace("'", "''"); | ||
} | ||
} |
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