sql-template-tag icon indicating copy to clipboard operation
sql-template-tag copied to clipboard

[feat]: Unique name for prepared statement

Open cesco69 opened this issue 7 months ago • 0 comments

Hi! Thanks for this awersome library!

Some library like pg has a name parameter for prepared statement. My suggestion is autogenerate this name, maybe by hashing the SQL

Eg.:

import { xxh32 } from "@node-rs/xxhash";

get name() {
    return xxh32(this.text).toString(16);
}

cesco69 avatar Mar 25 '25 09:03 cesco69