Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.
This repository was archived by the owner on May 14, 2026. It is now read-only.

Feature request - Adding support for INSERT OR UPDATE and INSERT OR IGNORE #391

Closed

Description

@mescanne

Hello - it would be great to use sqlalchemy with Spanner with the INSERT OR UPDATE and INSERT OR IGNORE functionality.

This seems to be handled directly within the dialects, e.g., here. However, it's not clear how this should be handled with sqlalchemy for Spanner.

Activity

  1. andrew-petukhov commented on Mar 31, 2024

    @andrew-petukhov

    Hello,
    It is possible to use the following statement with no changes to library:
    insert(users).prefix_with("OR IGNORE").values(dict(id=1, name="name1"))
    which will render to
    'INSERT OR IGNORE INTO users (id, name) VALUES (:id, :name)'

    Please notice that this statement is not supported yet in spanner emulator.

  2. added 2 commits that reference this issue on Nov 28, 2024
    d9350f3
    d76c7d6
  3. added a commit that references this issue on Nov 28, 2024
    6ff12ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions