Skip to content

sqlalchemy.schema.DropTable compilation: Table name should be quoted by back quotes (`) on DROP TABLE #349

Open
@rkawajiri

Description

@rkawajiri

Environment details

  • Programming language: python
  • OS: debian (official docker image python:3.11-bullseye)
  • Language runtime version: python 3.11.6
  • Package version:
    • sqlalchemy-spanner==1.6.2
    • sqlalchemy==2.0.22

Steps to reproduce

Execute this code.

from sqlalchemy.schema import DropTable, CreateTable
from sqlalchemy.orm import DeclarativeBase, mapped_column, Mapped
from google.cloud.sqlalchemy_spanner import SpannerDialect

class Base(DeclarativeBase):
    pass

class User(Base):
    __tablename__ = 'Users'

    id: Mapped[int] = mapped_column(primary_key=True)

print(CreateTable(User.__table__).compile(dialect=SpannerDialect()).string)
print(DropTable(User.__table__).compile(dialect=SpannerDialect()).string)

then it will print

CREATE TABLE `Users` (
	id INT64 NOT NULL
) PRIMARY KEY (id)

DROP TABLE "Users"

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy