You are not logged in.
Good afternoon!
For a long time I did not update my copy of the mORMot2, today I updated it to the trunk.
With the $define PUREMORMOT2 enabled, the mormot2 package is not compiled:
mormot.db.sql.odbc.pas(1213,8) Error: Identifier not found "TODBCConnectionProperties"
mormot.db.sql.odbc.pas(1216,30) Error: Identifier not found "TODBCConnectionProperties"
This occurs in the lines below:
if TODBCConnectionProperties(Connection.Properties).SqlStatementTimeoutSec > 0 then
ODBC.Check(nil, self,
ODBC.SetStmtAttrA(fStatement, SQL_ATTR_QUERY_TIMEOUT,
SqlPointer(PtrUInt(TODBCConnectionProperties(Connection.Properties).SqlStatementTimeoutSec)),
SQL_IS_INTEGER),
SQL_HANDLE_STMT, fStatement);
This is due to $ifndef PUREMORMOT2 condition check in the type declaration:
{$ifndef PUREMORMOT2}
// backward compatibility types redirections
type
TODBCConnectionProperties = TSqlDBOdbcConnectionProperties;
TODBCConnection = TSqlDBOdbcConnection;
TODBCStatement = TSqlDBOdbcStatement;
{$endif PUREMORMOT2}
If I disable $define PUREMORMOT2, then the mormot2 package is compiled successfully.
Offline
Sorry, but I don't see a new version of the mormot.db.sql.odbc unit in the trunk...
I updated to the trunk, but the error still here.
Offline
After latest commit all compiled successfully, thank you!
Offline
@ab - do we really need to throw in case ODBC driver name is not in predefined list?
I propose to remove this throw - https://github.com/synopse/mORMot2/blob … #L350-L352 (in mORMot1 also)
P.S.
I tries to use MS Access from Linux and driver name for FOSS ODBC MS Access driver is `mdbtools`, since it not contains `access` I got Exception. But the same exception will be throw for any ODBC driver we can works with, but it name is not in hard-coded constant in mormot.db.sql.odbc
Offline
I create a MR for mORMot1 to illustrate my proposal https://github.com/synopse/mORMot/pull/415
Offline
My guess is that a flag to ignore the name, and update the internal list (once a driver is tested) is better.
That is, keep the default behavior for safety, and only if you use an "unsupported driver", just set the flag and enjoy.
Of course, adding the unsupported driver names to the internal list is the best solution.
Offline
I do not know in advance which drivers will be used by my users. In my product database connection is configured, so I need to support any driver.
By "flag" you mean adds an ifdef directive?
Last edited by mpv (2021-12-01 12:18:13)
Offline
Please check https://github.com/synopse/mORMot2/comm … 54045a3e20 about a simple way to force a given kind of storage.
Also take a look at https://github.com/synopse/mORMot2/comm … b9119f7367 refactoring about thread safety of the connections.
Offline