You need to commit the transaction, you could turn autocommit on:
DBSession = scoped_session(sessionmaker(autocommit=True,
extension=ZopeTransactionExtension()))
On Saturday, January 26, 2013 2:20:39 PM UTC+10, Vincent Catalano wrote:
>
> Hello pyramid friends,
>
> I am currently using SQLAlchemy for a current pyramid project, however, I
> have come to a point where I need to be able to run some raw Postgres
> queries that have been parameterized (word?).
>
> I have tried the following to no avail:
>
> DBSession().execute(
> ''
> INSERT INTO users(id, user_name)
> VALUES (:id, :user_name)
> ''',
> {
> 'id': 2422,
> 'user_name': 'someguy'
> })
>
> The query appears to work since no error is thrown, however, no data is
> inserted into the database. What is the best way to run parameterized
> queries with SQLAlchemy?
>
> Thanks for your help.
>
> -Vincent
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.