Skip to content

Commit 1fd6879

Browse files
authored
Add Firebird 4 dialect (#3166)
* Add Firebird4Dialect * Add Firebird 4.0 test configuration * Add handling of BigInteger to numerical types * Set version 5.5.0-dev
1 parent 04ded09 commit 1fd6879

27 files changed

+183
-39
lines changed

.github/workflows/NetCoreTests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;"
2121
DB_INIT: |
2222
docker run --name firebird -e EnableWireCrypt=true -e FIREBIRD_USER=nhibernate -e FIREBIRD_PASSWORD=nhibernate -e ISC_PASSWORD=nhibernate -e FIREBIRD_DATABASE=nhibernate -p 3050:3050 -d jacobalberty/firebird:v3.0
23+
- DB: Firebird4
24+
CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;"
25+
DB_INIT: |
26+
docker run --name firebird -e EnableWireCrypt=true -e FIREBIRD_USER=nhibernate -e FIREBIRD_PASSWORD=nhibernate -e ISC_PASSWORD=nhibernate -e FIREBIRD_DATABASE=nhibernate -p 3050:3050 -d jacobalberty/firebird:v4.0
2327
- DB: MySQL
2428
CONNECTION_STRING: "Server=localhost;Uid=root;Password=nhibernate;Database=nhibernate;Old Guids=True;SslMode=none;"
2529
DB_INIT: |

appveyor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ environment:
77
- DB: PostgreSQL
88
CONNECTION_STRING: Host=localhost;Port=5432;Username=postgres;Password=Password12!;Database=nhibernate;Enlist=true;
99
- DB: Firebird
10+
- DB: Firebird4
1011
- DB: MySQL
1112
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;CharSet=utf8;
1213
- DB: SQLite
@@ -38,6 +39,27 @@ before_test:
3839
.\firebird.exe -a
3940
Pop-Location
4041
}
42+
'Firebird4' {
43+
$FireBirdPath = 'C:\firebird'
44+
# Install Firebird
45+
New-Item -ItemType Directory -Force $FireBirdPath > $null
46+
Push-Location $FireBirdPath
47+
Invoke-WebRequest 'https://github.com/FirebirdSQL/firebird/releases/download/v4.0.2/Firebird-4.0.2.2816-0-x64.zip' -OutFile firebird.zip
48+
Unblock-File firebird.zip
49+
7z x firebird.zip
50+
New-Item -ItemType Directory -Force Data
51+
# Declare nhibernate db
52+
Add-Content -Path '.\databases.conf' -Value "`r`nnhibernate = $FireBirdPath\Data\nhibernate.fdb"
53+
# Minimal db settings
54+
Add-Content -Path '.\firebird.conf' -Value "`r`nAuthServer = Srp`r`nAuthClient = Srp`r`nUserManager = Srp`r`nWireCrypt = Enabled"
55+
# Create SYSDBA account
56+
New-Item SYSDBA.sql -Type File
57+
Add-Content -Path '.\SYSDBA.sql' -Value "CREATE USER SYSDBA PASSWORD 'masterkey';`r`nCOMMIT;`r`nQUIT;"
58+
.\isql -user sysdba employee -input SYSDBA.sql
59+
# Start Firebird
60+
.\firebird.exe -a
61+
Pop-Location
62+
}
4163
'MySQL' {
4264
Start-Service 'MySQL57'
4365
# Create nhibernate database (not handled by NHibernate.TestDatabaseSetup.dll)

build-common/NHibernate.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<Import Condition="Exists('NHibernate.dev.props')" Project="NHibernate.dev.props"/>
33

44
<PropertyGroup>
5-
<NhVersion Condition="'$(NhVersion)' == ''" >5.4</NhVersion>
5+
<NhVersion Condition="'$(NhVersion)' == ''" >5.5</NhVersion>
66
<VersionPatch Condition="'$(VersionPatch)' == ''">0</VersionPatch>
77
<!-- Clear VersionSuffix for making release and set it to dev for making development builds -->
8-
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
8+
<VersionSuffix Condition="'$(VersionSuffix)' == ''">dev</VersionSuffix>
99
<LangVersion Condition="'$(MSBuildProjectExtension)' != '.vbproj'">9.0</LangVersion>
1010

1111
<VersionPrefix Condition="'$(VersionPrefix)' == ''">$(NhVersion).$(VersionPatch)</VersionPrefix>

lib/teamcity/firebird/firebird_installation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Installation steps for Firebird for NH TeamCity:
33

4-
1. Download Firebird (Firebird-3.0.2.32703_0_x64): https://www.firebirdsql.org/en/server-packages/;
4+
1. Download Firebird (Firebird-4.0.2.2816-0-x64): https://www.firebirdsql.org/en/server-packages/;
55
2. Run the installer AS ADMINISTRATOR... Use the default firebird password when prompted: masterkey.
66
3. Leave other settings with their defaults.
77
4. The setup should install Firebird on the machine;

psake.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Task Set-Configuration {
1414
'connection.driver_class' = 'NHibernate.Driver.FirebirdClientDriver';
1515
'dialect' = 'NHibernate.Dialect.FirebirdDialect'
1616
};
17+
'Firebird4' = @{
18+
'connection.connection_string' = 'DataSource=localhost;Database=nhibernate;User ID=SYSDBA;Password=masterkey;MaxPoolSize=200;';
19+
'connection.driver_class' = 'NHibernate.Driver.FirebirdClientDriver';
20+
'dialect' = 'NHibernate.Dialect.Firebird4Dialect'
21+
};
1722
'MySQL' = @{
1823
'connection.connection_string' = 'Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;';
1924
'connection.driver_class' = 'NHibernate.Driver.MySqlDataDriver';

src/NHibernate.Test/GeneratedTest/ComponentOwner.hbm.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
<![CDATA[DROP TRIGGER t_iu_part_gen_comp]]>
7373
</drop>
7474
<dialect-scope name="NHibernate.Dialect.FirebirdDialect"/>
75+
<dialect-scope name="NHibernate.Dialect.Firebird4Dialect"/>
7576
</database-object>
7677

77-
</hibernate-mapping>
78+
</hibernate-mapping>

src/NHibernate.Test/Generatedkeys/Select/MyEntity.hbm.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CREATE GENERATOR MYGENERATOR;
2121
DROP GENERATOR MYGENERATOR;
2222
</drop>
2323
<dialect-scope name="NHibernate.Dialect.FirebirdDialect"/>
24+
<dialect-scope name="NHibernate.Dialect.Firebird4Dialect"/>
2425
</database-object>
2526

2627
<database-object>
@@ -37,6 +38,7 @@ END
3738
DROP TRIGGER my_entity_BI;
3839
</drop>
3940
<dialect-scope name="NHibernate.Dialect.FirebirdDialect"/>
41+
<dialect-scope name="NHibernate.Dialect.Firebird4Dialect"/>
4042
</database-object>
4143

4244
<database-object>
@@ -71,4 +73,4 @@ DROP TRIGGER my_entity_BI;
7173
</database-object>
7274

7375

74-
</hibernate-mapping>
76+
</hibernate-mapping>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace NHibernate.Test.TestDialects
2+
{
3+
public class Firebird4TestDialect : FirebirdTestDialect
4+
{
5+
public Firebird4TestDialect(Dialect.Dialect dialect) : base(dialect)
6+
{
7+
}
8+
}
9+
}

src/NHibernate/Async/Type/ByteType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Collections;
1313
using System.Data;
1414
using System.Data.Common;
15+
using System.Numerics;
1516
using NHibernate.Engine;
1617
using NHibernate.SqlTypes;
1718

src/NHibernate/Async/Type/Int16Type.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using NHibernate.SqlTypes;
1616
using System.Collections.Generic;
1717
using System.Data;
18+
using System.Numerics;
1819

1920
namespace NHibernate.Type
2021
{

0 commit comments

Comments
 (0)