Skip to content

[BUG]: Generate columns : The doc info is invalid #3722

Open
@maxpaleo

Description

@maxpaleo

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.37.0

What version of drizzle-kit are you using?

0.29.1

Other packages

No response

Describe the Bug

I spent the past 3 hours trying to figure out an error I kept on running into with generate columns.
These are the docs I referenced: https://orm.drizzle.team/docs/generated-columns

Every example shown in the doc will throw an error

export const test = pgTable("test", {
    generatedName: text("gen_name").generatedAlwaysAs(sql`hello "world"!`),
});
// Error: error: syntax error at or near "world"
export const test = pgTable("test", {
    generatedName: text("gen_name").generatedAlwaysAs(sql`hello "world"!`),
});
// Error: error: syntax error at or near "world"

Is this article deprecated? Or what is the correct to assign text to generated columns?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentationdocs/incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions