Skip to content

error TS2345: Argument of type 'TransactionSql<{}>' is not assignable to parameter of type 'Sql<{}>' #1163

@maarre

Description

@maarre

This is typescript.

src/importdog.ts(58,92): error TS2345: Argument of type 'TransactionSql<{}>' is not assignable to parameter of type 'Sql<{}>'.
Type 'TransactionSql<{}>' is missing the following properties from type 'Sql<{}>': CLOSE, END, PostgresError, options, and 7 more.

This works in postgres 3.4.7. It didn't work in 3.4.8. It doesn't work in 3.4.9.

export const dog_subsidy = postgres({
            user: 'dog_subsidy',
            password: process.env.DOG_SUBSIDY_PASSWORD,
            host: 'localhost',
            port: 5432,
            database: 'dog_subsidy',
            max: os.cpus().length,
            debug: postgres_logger
        })
export async function sp_personsimm_create_v1(params: IfsPersonParamsSpPersonsimmCreateV1, breadcrumb: string, db = dog_subsidy): Promise<number |UserError> {
await dog_subsidy.begin(async conn => {
                const breeder = dog.breeder
                const breeder_imm =
                    new PersonParamsSpPersonsimmCreateV1(breeder.social_security_number.toString(), undefined)
                const breederimm_pk = await sp_personsimm_create_v1(breeder_imm, uuidv4(), conn)

The error is the last parameter in call to await sp_personsimm_create_v1(breeder_imm, uuidv4(), conn)

$ grep -e postgres -e typescript -e 'tsup":' package.json
    "postgres": "3.4.9",
    "tsup": "8.5.1",
    "typescript": "5.9.3",
$ node --version
v22.16.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions