Error
Traceback (most recent call last):
File "some_postgresqlx.py", line 874, in test_select
expected, self.db['employee'].select(['id', 'firstName'])
File "sqllex\sqllex\core\entities\abc\sql_database.py", line 249, in select
return self.db.select(
File "sqllex\sqllex\core\entities\abc\sql_database.py", line 1553, in select
return self.execute(script=script, values=values)
File "sqllex\sqllex\core\entities\abc\sql_database.py", line 1018, in execute
return self._executor(script=script, values=values, spec=1)
File "sqllex\sqllex\core\entities\postgresqlx\postgresqlx.py", line 273, in _executor
return middleware.execute(script=script, values=values, connection=self.connection)
File "sqllex\sqllex\core\entities\postgresqlx\middleware.py", line 48, in execute
return mw_executor(conn=connection, script=script, values=values)
File "sqllex\sqllex\core\entities\postgresqlx\middleware.py", line 36, in mw_executor
raise error
File "sqllex\sqllex\core\entities\postgresqlx\middleware.py", line 19, in mw_executor
cur.execute(script)
psycopg2.errors.UndefinedColumn: column "firstname" does not exist
LINE 1: SELECT id, firstName FROM "employee"
^
HINT: Perhaps you meant to reference the column "employee.firstName".
Temporary fix
use " or full column name employee."firstName"
db['employee'].select("""
id, "firstName"
""")
# OR
db['employee'].select('employee.id', 'employee."firstName"')
Code
Temporary fix
use
"
or full column nameemployee."firstName"