Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:leafac/sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
leafac committed Apr 19, 2023
2 parents 70e874e + 687b61b commit adc715b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/index.mts
Expand Up @@ -49,11 +49,11 @@ export default function sql(
`${templatePart}${substitutionQuery.sourceParts[0]}`,
...substitutionQuery.sourceParts.slice(1, -1)
);
templateParts[substitutionsIndex + 1] = `${
substitutionQuery.sourceParts[
substitutionQuery.sourceParts.length - 1
]
}${templateParts[substitutionsIndex + 1]}`;
templateParts[
substitutionsIndex + 1
] = `${substitutionQuery.sourceParts.at(-1)}${
templateParts[substitutionsIndex + 1]
}`;
parameters.push(...substitutionQuery.parameters);
}
} else if (Array.isArray(substitution)) {
Expand All @@ -76,7 +76,7 @@ export default function sql(
parameters.push(substitution);
}
}
sourceParts.push(templateParts[templateParts.length - 1]);
sourceParts.push(templateParts.at(-1)!);
return { sourceParts, parameters };
}

Expand Down Expand Up @@ -185,7 +185,7 @@ export class Database extends BetterSqlite3Database {
SELECT quote(${query.parameters[parametersIndex]}) AS "parameter"
`
)!.parameter;
source += query.sourceParts[query.sourceParts.length - 1];
source += query.sourceParts.at(-1);
return this.exec(source);
}

Expand Down

0 comments on commit adc715b

Please sign in to comment.