forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNpgsqlDriver.cs
76 lines (69 loc) · 1.76 KB
/
NpgsqlDriver.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
namespace NHibernate.Driver
{
/// <summary>
/// The PostgreSQL data provider provides a database driver for PostgreSQL.
/// <p>
/// Author: <a href="mailto:oliver@weichhold.com">Oliver Weichhold</a>
/// </p>
/// </summary>
/// <remarks>
/// <p>
/// In order to use this Driver you must have the Npgsql.dll Assembly available for
/// NHibernate to load it.
/// </p>
/// <p>
/// Please check the products website
/// <a href="http://www.postgresql.org/">http://www.postgresql.org/</a>
/// for any updates and or documentation.
/// </p>
/// <p>
/// The homepage for the .NET DataProvider is:
/// <a href="http://pgfoundry.org/projects/npgsql">http://pgfoundry.org/projects/npgsql</a>.
/// </p>
/// </remarks>
public class NpgsqlDriver : ReflectionBasedDriver
{
/// <summary>
/// Initializes a new instance of the <see cref="NpgsqlDriver"/> class.
/// </summary>
/// <exception cref="HibernateException">
/// Thrown when the <c>Npgsql</c> assembly can not be loaded.
/// </exception>
public NpgsqlDriver() : base(
"Npgsql",
"Npgsql",
"Npgsql.NpgsqlConnection",
"Npgsql.NpgsqlCommand")
{
}
public override bool UseNamedPrefixInSql
{
get { return true; }
}
public override bool UseNamedPrefixInParameter
{
get { return true; }
}
public override string NamedPrefix
{
get { return ":"; }
}
public override bool SupportsMultipleOpenReaders
{
get { return false; }
}
protected override bool SupportsPreparingCommands
{
// NH-2267 Patrick Earl
get { return true; }
}
public override IResultSetsCommand GetResultSetsCommand(Engine.ISessionImplementor session)
{
return new BasicResultSetsCommand(session);
}
public override bool SupportsMultipleQueries
{
get { return true; }
}
}
}