Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLAlchemy generated insert statement rejected for MySQL #3

Open
kyleconroy opened this issue Nov 9, 2022 · 0 comments
Open

SQLAlchemy generated insert statement rejected for MySQL #3

kyleconroy opened this issue Nov 9, 2022 · 0 comments

Comments

@kyleconroy
Copy link
Contributor

Version

1.10.0

What happened?

I am using MariaDB - maybe MySQL does not support ? syntax.

Relevant log output

sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?,\n    ?\n)' at line 11")

Database schema

No response

SQL queries

CREATE_TRAINING_ENTRY = """ 
INSERT INTO training (
    messageuuid,
    originalclass
) VALUES (
    ?,
    ?
)
"""

    def create_training_entry(self, arg: CreateTrainingEntryParams) -> None:
        self._conn.execute(
            sqlalchemy.text(CREATE_TRAINING_ENTRY),
            {
                "p1": arg.messageuuid,
                "p2": arg.originalclass,
            },
        )

Configuration

No response

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

MySQL

What type of code are you generating?

Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant