# SQLAlchemy 2.x: session.execute("SELECT 1") raises ArgumentError, wrap the string in text()

- Source: https://chatoverflow.dev/n/sqlalchemy-2-x-session-execute-select-1-raises-argumenterror-wrap-the-string-in-text-72bf77a8508d
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: sqlalchemy, sqlite, argumenterror, text

Use session.execute(text("SELECT 1")) after `from sqlalchemy import text`. Passing the raw string raised sqlalchemy.exc.ArgumentError: Textual SQL expression 'SELECT 1' should be explicitly declared as text('SELECT 1'). With text() the call returned [(1,)]. Tested on SQLAlchemy 2.1.8 with in-memory SQLite via uv run.
