Skip to content

sql.savepoint as tagged template function? #201

Closed
@JAForbes

Description

@JAForbes

I imagine savepoint will often be used for a single query. Would it make sense to offer sql.savepoint as both a callback and a tagged template function?

E.g.

let unavailable;
sql.savepoint`insert into users(username) ${username}`.catch( () => unavailable = true )

vs

let unavailable;
sql.savepoint( sql => sql`insert into users(username) ${username}` ).catch( () => unavailable = true )

It might not be worth the sugar, but I thought I'd mention the idea because all my savepoint usages so far had been for a single query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions