Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gajus/slonik
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v34.0.1
Choose a base ref
...
head repository: gajus/slonik
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v34.1.0
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Aug 9, 2023

  1. Copy the full SHA
    ed6b9a9 View commit details
Showing with 8 additions and 6 deletions.
  1. +1 −0 src/sqlFragmentFactories/createIntervalSqlFragment.ts
  2. +7 −6 test/slonik/templateTags/sql/interval.ts
1 change: 1 addition & 0 deletions src/sqlFragmentFactories/createIntervalSqlFragment.ts
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ const IntervalInput = z
const intervalFragments = [
'years',
'months',
'weeks',
'days',
'hours',
'minutes',
13 changes: 7 additions & 6 deletions test/slonik/templateTags/sql/interval.ts
Original file line number Diff line number Diff line change
@@ -16,18 +16,19 @@ test('creates an empty make_interval invocation', (t) => {

test('creates an interval', (t) => {
const query = sql.fragment`SELECT ${sql.interval({
days: 3,
hours: 4,
minutes: 5,
days: 4,
hours: 5,
minutes: 6,
months: 2,
seconds: 6,
seconds: 7,
weeks: 3,
years: 1,
})}`;

t.deepEqual(query, {
sql: 'SELECT make_interval(years => $1, months => $2, days => $3, hours => $4, mins => $5, secs => $6)',
sql: 'SELECT make_interval(years => $1, months => $2, weeks => $3, days => $4, hours => $5, mins => $6, secs => $7)',
type: FragmentToken,
values: [1, 2, 3, 4, 5, 6],
values: [1, 2, 3, 4, 5, 6, 7],
});
});