Comment out DateTimeModifier.auto and DateTimeModifier.julianDay

Make DateTimeModifier.unixEpoch private
This commit is contained in:
Alexander Wilde 2022-07-05 11:38:54 +01:00
parent 695e42b638
commit a82bd0b979
1 changed files with 30 additions and 30 deletions

View File

@ -40,26 +40,26 @@ extension DateTimeExpressions on Expression<DateTime?> {
/// Formats this datetime in the format `year-month-day`. /// Formats this datetime in the format `year-month-day`.
Expression<String?> get date => FunctionCallExpression( Expression<String?> get date => FunctionCallExpression(
'DATE', [this, const DateTimeModifier.unixEpoch()]); 'DATE', [this, const DateTimeModifier._unixEpoch()]);
/// Formats this datetime in the format `hour:minute:second`. /// Formats this datetime in the format `hour:minute:second`.
Expression<String?> get time => FunctionCallExpression( Expression<String?> get time => FunctionCallExpression(
'TIME', [this, const DateTimeModifier.unixEpoch()]); 'TIME', [this, const DateTimeModifier._unixEpoch()]);
/// Formats this datetime in the format `year-month-day hour:minute:second`. /// Formats this datetime in the format `year-month-day hour:minute:second`.
Expression<String?> get datetime => FunctionCallExpression( Expression<String?> get datetime => FunctionCallExpression(
'DATETIME', [this, const DateTimeModifier.unixEpoch()]); 'DATETIME', [this, const DateTimeModifier._unixEpoch()]);
/// Formats this datetime as a unix timestamp - the number of seconds since /// Formats this datetime as a unix timestamp - the number of seconds since
/// 1970-01-01 00:00:00 UTC. The unixepoch() always returns an integer, even /// 1970-01-01 00:00:00 UTC. The unixepoch() always returns an integer, even
/// if the input time-value has millisecond precision. /// if the input time-value has millisecond precision.
Expression<int?> get unixepoch => FunctionCallExpression( Expression<int?> get unixepoch => FunctionCallExpression(
'UNIXEPOCH', [this, const DateTimeModifier.unixEpoch()]); 'UNIXEPOCH', [this, const DateTimeModifier._unixEpoch()]);
/// Formats this datetime in the Julian day format - a fractional number of /// Formats this datetime in the Julian day format - a fractional number of
/// days since noon in Greenwich on November 24, 4714 B.C. /// days since noon in Greenwich on November 24, 4714 B.C.
Expression<double?> get julianday => FunctionCallExpression( Expression<double?> get julianday => FunctionCallExpression(
'JULIANDAY', [this, const DateTimeModifier.unixEpoch()]); 'JULIANDAY', [this, const DateTimeModifier._unixEpoch()]);
/// Formats this datetime according to the format string specified as the /// Formats this datetime according to the format string specified as the
/// first argument. The format string supports the most common substitutions /// first argument. The format string supports the most common substitutions
@ -81,14 +81,14 @@ extension DateTimeExpressions on Expression<DateTime?> {
/// * %% % /// * %% %
Expression<String?> strftime(String format) => FunctionCallExpression( Expression<String?> strftime(String format) => FunctionCallExpression(
'STRFTIME', 'STRFTIME',
[Constant<String>(format), this, const DateTimeModifier.unixEpoch()]); [Constant<String>(format), this, const DateTimeModifier._unixEpoch()]);
/// Apply a modifier that alters the date and/or time. /// Apply a modifier that alters the date and/or time.
Expression<DateTime?> modify(DateTimeModifier modifier) => Expression<DateTime?> modify(DateTimeModifier modifier) =>
FunctionCallExpression('strftime', [ FunctionCallExpression('strftime', [
const Constant<String>('%s'), const Constant<String>('%s'),
this, this,
const DateTimeModifier.unixEpoch(), const DateTimeModifier._unixEpoch(),
modifier modifier
]); ]);
@ -99,7 +99,7 @@ extension DateTimeExpressions on Expression<DateTime?> {
FunctionCallExpression('strftime', [ FunctionCallExpression('strftime', [
const Constant<String>('%s'), const Constant<String>('%s'),
this, this,
const DateTimeModifier.unixEpoch(), const DateTimeModifier._unixEpoch(),
...modifiers ...modifiers
]); ]);
@ -248,30 +248,30 @@ class DateTimeModifier extends Constant<String> {
/// For SQLite versions before 3.16.0 (2017-01-02), the "unixepoch" modifier /// For SQLite versions before 3.16.0 (2017-01-02), the "unixepoch" modifier
/// only works for dates between 0000-01-01 00:00:00 and 5352-11-01 10:52:47 /// only works for dates between 0000-01-01 00:00:00 and 5352-11-01 10:52:47
/// (unix times of -62167219200 through 106751991167). /// (unix times of -62167219200 through 106751991167).
const DateTimeModifier.unixEpoch() : this._('unixepoch'); const DateTimeModifier._unixEpoch() : this._('unixepoch');
/// The "julianday" modifier must immediately follow the initial time-value // The "julianday" modifier must immediately follow the initial time-value
/// which must be of the form DDDDDDDDD. Any other use of the 'julianday' // which must be of the form DDDDDDDDD. Any other use of the 'julianday'
/// modifier is an error and causes the function to return NULL. The // modifier is an error and causes the function to return NULL. The
/// 'julianday' modifier forces the time-value number to be interpreted as a // 'julianday' modifier forces the time-value number to be interpreted as a
/// julian-day number. As this is the default behavior, the 'julianday' // julian-day number. As this is the default behavior, the 'julianday'
/// modifier is scarcely more than a no-op. The only difference is that adding // modifier is scarcely more than a no-op. The only difference is that adding
/// 'julianday' forces the DDDDDDDDD time-value format, and causes a NULL to // 'julianday' forces the DDDDDDDDD time-value format, and causes a NULL to
/// be returned if any other time-value format is used. // be returned if any other time-value format is used.
const DateTimeModifier.julianDay() : this._('julianday'); //const DateTimeModifier.julianDay() : this._('julianday');
/// The "auto" modifier must immediately follow the initial time-value. If the // The "auto" modifier must immediately follow the initial time-value. If the
/// time-value is numeric (the DDDDDDDDDD format) then the 'auto' modifier // time-value is numeric (the DDDDDDDDDD format) then the 'auto' modifier
/// causes the time-value to interpreted as either a julian day number or a // causes the time-value to interpreted as either a julian day number or a
/// unix timestamp, depending on its magnitude. If the value is between 0.0 // unix timestamp, depending on its magnitude. If the value is between 0.0
/// and 5373484.499999, then it is interpreted as a julian day number // and 5373484.499999, then it is interpreted as a julian day number
/// (corresponding to dates between -4713-11-24 12:00:00 and 9999-12-31 // (corresponding to dates between -4713-11-24 12:00:00 and 9999-12-31
/// 23:59:59, inclusive). For numeric values outside of the range of valid // 23:59:59, inclusive). For numeric values outside of the range of valid
/// julian day numbers, but within the range of -210866760000 to 253402300799, // julian day numbers, but within the range of -210866760000 to 253402300799,
/// the 'auto' modifier causes the value to be interpreted as a unix // the 'auto' modifier causes the value to be interpreted as a unix
/// timestamp. Other numeric values are out of range and cause a NULL return. // timestamp. Other numeric values are out of range and cause a NULL return.
/// The 'auto' modifier is a no-op for text time-values. // The 'auto' modifier is a no-op for text time-values.
const DateTimeModifier.auto() : this._('auto'); //const DateTimeModifier.auto() : this._('auto');
/// The "localtime" modifier (14) assumes the time value to its left is in /// The "localtime" modifier (14) assumes the time value to its left is in
/// Universal Coordinated Time (UTC) and adjusts that time value so that it is /// Universal Coordinated Time (UTC) and adjusts that time value so that it is