I'm trying to insert something into paradox .db file, but I get this error:
TypeError: visit_insert() takes 2 positional arguments but 3 were given
I don't understand, what I'm doing wrong. I read docs and surf a lot, tried different code, but it doesn't work anyway....
My code:
import sqlalchemy_paradox
import sqlalchemy as db
from sqlalchemy import create_engine
from sqlalchemy import insert, select, update
engine = create_engine("paradox+pyodbc://@paradox", echo=False)
connection = engine.connect()
metadata = db.MetaData()
Test = db.Table('Test', metadata, autoload=True, autoload_with=engine)
list_values={'NAME':'John', 'FULLNAME':'John Smith'}
stmt=insert(Test).values(list_values)
connection.execute(stmt)
Select statement works fine (and even update). And a little about my Test table. This code:
print(Test.c.keys())
stmt = 'SELECT * FROM Test'
results = connection.execute(stmt).fetchall()
print(results)
gives this results
['ID', 'NAME', 'FULLNAME']
[(1, 'My', 'My first')]
How to make insert work?