New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up FormatSystemMethods quoter #1156
Milestone
Comments
Something like this: src\FluentMigrator.Runner.Db2\Generators\Db2\Db2Quoter.cs {
switch (value)
{
case SystemMethods.NewSequentialId:
case SystemMethods.NewGuid:
return base.FormatSystemMethods(value);
case SystemMethods.CurrentUTCDateTime:
/*
* (The CURRENT TIMEZONE value is determined from C runtime functions.)
* Source: https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.7.0/com.ibm.db2.luw.sql.ref.doc/doc/r0005887.html
*/
return "(CURRENT_TIMESTAMP - CURRENT_TIMEZONE)";
case SystemMethods.CurrentDateTime:
return "CURRENT_TIMESTAMP"; src\FluentMigrator.Runner.Firebird\Generators\Firebird\FirebirdQuoter.cs case SystemMethods.NewSequentialId:
case SystemMethods.NewGuid:
return "gen_uuid()";
case SystemMethods.CurrentDateTime:
return "CURRENT_TIMESTAMP";
case SystemMethods.CurrentUser:
return "CURRENT_USER";
/*
Firebird v.3.0.4: Context variables LOCALTIME and LOCALTIMESTAMP were added as synonyms for CURRENT_TIME and CURRENT_TIMESTAMP, respectively, in anticipation of CURRENT_TIME and CURRENT_TIMESTAMP being redefined in Firebird 4 to represent the time and timestamp in UTC time, to comply with the SQL standards.
Source: https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/bk02ch09s06.html
Source: https://github.com/FirebirdSQL/firebird/blob/master/doc/sql.extensions/README.time_zone.md#changes-in-current_time-and-current_timestamp
*/
case SystemMethods.CurrentDateTime:
return "LOCALTIMESTAMP";
case SystemMethods.CurrentDateTimeOffset:
throw new ArgumentException($"{nameof(SystemMethods.CurrentDateTimeOffset)} not supported.");
case SystemMethods.CurrentUTCDateTime:
return "CURRENT_TIMESTAMP";
} src\FluentMigrator.Runner.MySql\Generators\MySql\MySqlQuoter.csnamespace FluentMigrator.Runner.Generators.MySql
@ -51,6 +53,8 @@ namespace FluentMigrator.Runner.Generators.MySql
return "UTC_TIMESTAMP";
case SystemMethods.CurrentUser:
return "CURRENT_USER()";
case SystemMethods.CurrentDateTimeOffset:
throw new ArgumentException($"{nameof(SystemMethods.CurrentDateTimeOffset)} not supported.");
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: