forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNpgsqlSourceInformation.cs
More file actions
46 lines (43 loc) · 1.76 KB
/
NpgsqlSourceInformation.cs
File metadata and controls
46 lines (43 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Data.Framework.AdoDotNet;
namespace Npgsql.VSIX
{
public class NpgsqlSourceInformation : AdoDotNetSourceInformation
{
public NpgsqlSourceInformation()
{
AddProperty(CatalogSupported, false);
AddProperty(CatalogSupportedInDml, false);
AddProperty(DefaultSchema, "public");
AddProperty(IdentifierOpenQuote, "\"");
AddProperty(IdentifierCloseQuote, "\"");
AddProperty(IdentifierPartsCaseSensitive, false);
//AddProperty(IdentifierPartsStorageCase, "M");
AddProperty(ParameterPrefix, "@");
AddProperty(ParameterPrefixInName, false);
AddProperty(QuotedIdentifierPartsCaseSensitive, true);
AddProperty(QuotedIdentifierPartsStorageCase, "M");
AddProperty(SchemaSeparator, ".");
AddProperty(SchemaSupported, true);
AddProperty(SchemaSupportedInDml, true);
AddProperty(SupportsAnsi92Sql, true);
AddProperty(SupportsNestedTransactions, false);
AddProperty(SupportsQuotedIdentifierParts, true);
AddProperty(UserSupported, false);
AddProperty(ViewSupported, true);
}
protected override object RetrieveValue(string propertyName)
{
if (AreEqual(propertyName, DataSourceVersion))
return Connection.ServerVersion ?? "";
return base.RetrieveValue(propertyName);
}
static bool AreEqual(string propertyName, string candidate)
=> propertyName.Equals(candidate, StringComparison.OrdinalIgnoreCase);
}
}