Skip to content

createSchema doesn't escape the schema name #15651

Closed

Description

@meyfa

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Bug Description

See issue #4202. The problem still exists. I'd like to create a PostgreSQL schema with a hyphen (let's say "my-application"), but this results in the following error:

syntax error at or near \"-\"

Reproducible Example

import { Sequelize } from 'sequelize'

const db = new Sequelize(process.env.POSTGRESQL_URL)
await db.authenticate()
await db.createSchema('my-application', {})

What do you expect to happen?

The schema my-application is created.

What is actually happening?

I receive syntax error at or near \"-\".

Environment

  • Sequelize version: 6.28.0
  • Node.js version: 18.13.0
  • If TypeScript related: TypeScript version: 4.9.5
  • Database & Version: PostgreSQL 15.1.0
  • Connector library & Version: [email protected]

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.

Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.

Activity

  1. added
    pending-approval
    type: bug
    on Feb 6, 2023
  2. added and removed
    pending-approval
    on Feb 6, 2023
  3. ephys commented on Feb 6, 2023

    @ephys
    Member

    This has been fixed in Sequelize 7, the fix can be backported to v6

  4. meyfa commented on Feb 8, 2023

    @meyfa
    Author

    Awesome! I was unable to find the relevant changelog entry from v7, could you point me in the right direction? Then I could attempt a PR with the backport.

  5. rushilmehra commented on Feb 18, 2023

    @rushilmehra

    I’d like to pick this up

  6. WikiRik commented on Feb 22, 2023

    @WikiRik
    Member

    Awesome! I was unable to find the relevant changelog entry from v7, could you point me in the right direction? Then I could attempt a PR with the backport.

    I assume it was part of the various fixes done in #14999

  7. meyfa commented on Mar 9, 2023

    @meyfa
    Author

    @rushilmehra I see you were assigned, but since it seems like you haven't yet made a PR, I went ahead and opened #15752 myself - I hope that's okay.

  8. added a commit that references this issue on Mar 9, 2023
    1ad9a64
  9. github-actions commented on Mar 9, 2023

    @github-actions
    Contributor

    🎉 This issue has been resolved in version 6.29.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  10. assigned and unassigned on Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

releasedtype: bugv6

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions