Repository navigation
What's new in v4.0.53
Oracle synonym support and generated code for MySQL, Oracle and PostgreSQL that compiles and runs. SQL Server
output is unchanged.
Update the efrpg tool to 1.3.0 (dotnet tool update -g Efrpg) for synonyms, MySQL enumerations and PostgreSQL
function return models.
Oracle synonyms (#886)
With FilterSettings.IncludeSynonyms = true, private synonyms owned by the schema you connect as are reverse
engineered under the synonym's name: tables, views, procedures, functions and package members. Foreign keys are
remapped to the synonym names on both sides, so navigation properties work between synonyms, and between a table and
a synonym.
Not covered yet: PUBLIC synonyms, synonyms over a database link, synonyms for synonyms, and the indexes and comments
behind a synonym.
Stored procedures on MySQL, Oracle and PostgreSQL
These were generated with SQL Server's syntax - EXEC @procResult = [schema].[name] ... OUTPUT, and SqlDbType on
the provider's own parameter type - so they did not compile. They now use each database's own call:
- Oracle:
BEGIN "SCHEMA"."NAME"(:A, :B); END; - PostgreSQL:
CALL "schema"."name"(@a, @b) - MySQL:
CALL `schema`.`name`(@a, @b), or aCommandType.StoredProcedurecommand when the procedure has OUT or
INOUT parameters, which MySQL cannot return from a text command.
Also:
- OUT parameters are
outarguments again; they were missing from the signature. - Parameters are typed with
DbType, so Oracle OUT values come back as .NET types, such asdecimal, rather than
OracleDecimal. - Methods still return
int, but return 0: only SQL Server procedures have a return status. - Oracle package members are generated:
ORDER_PKG.TOUCH_PARENTbecomesOrderPkgTouchParent, and package functions
map as[DbFunction("\"SCHEMA\".\"PKG\".\"FUNC\"", IsBuiltIn = true)]. - An Oracle
SYS_REFCURSOROUT parameter is anout objectholding theOracleRefCursor. Open the connection first
to read it. - PostgreSQL table valued functions are called as
"schema"."name"(...)rather than[schema].[name](...), and a
function's OUT columns are no longer passed as arguments.
Generated code that compiles and builds its model
IsClustered()is emitted for SQL Server only. It appeared on every MySQL primary key and on Oracle index-organised
tables, and it only exists in the SQL Server provider.- MySQL:
UseMySqlnow passesServerVersion.AutoDetect(...), which Pomelo requires.- A
char(36)string column no longer names its store type; Pomelo reserveschar(36)forGuid, and the model
threw while building. - A
timestamp ... ON UPDATE CURRENT_TIMESTAMPcolumn is no longer treated as a SQL Server rowversion.
- Oracle:
TIMESTAMP WITH TIME ZONEmaps toDateTimeOffset.- A foreign key whose numeric type differs from its key's, such as
NUMBER(19)referencingNUMBER, takes the
key's type, as EF requires.
- PostgreSQL:
- A schema name with spaces no longer produces an invalid class name:
Mixed Case Schema_Thingis now
MixedCaseSchema_Thing. cidrmaps toNpgsqlCidr.PhysicalAddresscolumns importSystem.Net.NetworkInformation.
- A schema name with spaces no longer produces an invalid class name:
- An entity whose name is already taken by a configured enum gets a suffix, such as
Status1, instead of colliding
with the enum. - EF6 on PostgreSQL:
- Columns EF6 cannot map (bit strings, arrays,
uint, and Npgsql's network, geometric, text search and range types)
are left out. - Table valued functions use
@namein Entity SQL and no longer passOUTPUT. System.Data.SqlClientis no longer imported.
- Columns EF6 cannot map (bit strings, arrays,
efrpg 1.3.0
- Reads Oracle synonyms.
- Reads MySQL enumerations. Its query used
SELECT ..., *, which MySQL rejects, so none were ever read. - Returns the result columns of a PostgreSQL function with OUT parameters, so its return model is generated.
- Pins
System.Security.Cryptography.Pkcs10.0.13 over the vulnerable 9.0.13 that SqlClient and ODP.NET bring in.
The wire format is unchanged (schema version 3), so earlier templates keep working with 1.3.0.
Check before upgrading
MySQL, Oracle and PostgreSQL output changes only where it was broken before:
- Procedure signatures gain their OUT parameters, lose the
= nulldefault on any parameter before anout, and
return 0. - An entity that shares a configured enum's name is renamed with a
1suffix. - Oracle
TIMESTAMP WITH TIME ZONEproperties becomeDateTimeOffset, PostgreSQLcidrproperties become
NpgsqlCidr, and mismatched numeric foreign key properties take their key's type. - MySQL
ON UPDATE CURRENT_TIMESTAMPcolumns are no longer concurrency tokens. - MySQL contexts call
ServerVersion.AutoDetect, which connects to the server when the options are built. - If you update efrpg to 1.3.0 but stay on an older template, configured MySQL enumerations start generating, and an
enum named after its own table now collides with that table's entity. Upgrading the template avoids it.
Notes
- New Oracle test schema
TestDatabases/Oracle/EfrpgTestSynonyms.sql, loaded by the Oracledocker-compose.yml.