Skip to content

Commit

Permalink
Add nocov markings around unused code only kept for backwards compati…
Browse files Browse the repository at this point in the history
…bility

This methods are no longer used, but remain in case an external
adapter is using them.  They will be removed in Sequel 6.
  • Loading branch information
jeremyevans committed Dec 29, 2023
1 parent 436e109 commit f7d161f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/sequel/adapters/shared/postgres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2150,10 +2150,14 @@ def supports_skip_locked?
server_version >= 90500
end

# :nocov:

# PostgreSQL supports timezones in literal timestamps
def supports_timestamp_timezones?
# SEQUEL6: Remove
true
end
# :nocov:

# PostgreSQL 8.4+ supports WINDOW clause.
def supports_window_clause?
Expand Down
4 changes: 4 additions & 0 deletions lib/sequel/dataset/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,14 @@ def supports_select_all_and_column?
true
end

# :nocov:

# Whether the dataset supports timezones in literal timestamps, false by default.
def supports_timestamp_timezones?
# SEQUEL6: Remove
false
end
# :nocov:

# Whether the dataset supports fractional seconds in literal timestamps, true by default.
def supports_timestamp_usecs?
Expand Down
4 changes: 4 additions & 0 deletions lib/sequel/dataset/sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1206,14 +1206,18 @@ def format_timestamp(v)
db.from_application_timestamp(v).strftime(default_timestamp_format)
end

# :nocov:

# Return the SQL timestamp fragment to use for the fractional time part.
# Should start with the decimal point. Uses 6 decimal places by default.
def format_timestamp_usec(usec, ts=timestamp_precision)
# SEQUEL6: Remove
unless ts == 6
usec = usec/(10 ** (6 - ts))
end
sprintf(".%0#{ts}d", usec)
end
# :nocov:

# Append literalization of identifier to SQL string, considering regular strings
# as SQL identifiers instead of SQL strings.
Expand Down

0 comments on commit f7d161f

Please sign in to comment.