Skip to content

[BUG]: AnySQLiteColumn in generated schema is not prefixed by "type" keyword #4247

@NicoToff

Description

@NicoToff

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.40.0

What version of drizzle-kit are you using?

0.30.5

Other packages

node@23

Describe the Bug

Hello. I stumbled upon a small issue when using nodejs >= 23.

What is the undesired behavior?

When running drizzle-kit pull, the schema file contains an AnySQLiteColumn import for a type, but this import is not prefixed by the type keyword. Since nodejs does a "dumb" type stripping, it doesn't strip AnySQLiteColumn and throws a runtime error because there is no JS AnySQLiteColumn export.

What are the steps to reproduce it?

Run AnySQLiteColumn with any DB and try to use the schema. At runtime it throws something like this:

Image

What is the desired result?

The AnySQLiteColumn import should be prefixed by type.

This is what is curenly output:

import {
    sqliteTable,
    AnySQLiteColumn,
    integer,
    text,
    foreignKey,
} from "drizzle-orm/sqlite-core";

This is the desired output:

import {
    sqliteTable,
    type AnySQLiteColumn,
    integer,
    text,
    foreignKey,
} from "drizzle-orm/sqlite-core";

Not urgent ;)

This is more of an "upcoming" issue as people will likely rely more and more on the "type striping" feature of node in the upcoming years.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug/fixed-in-betaThis bug has been fixed in beta (or will be soon).drizzle/kit

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions