{"action":"created","issue":{"url":"https://api.github.com/repos/aio-libs/aiopg/issues/46","labels_url":"https://api.github.com/repos/aio-libs/aiopg/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/aio-libs/aiopg/issues/46/comments","events_url":"https://api.github.com/repos/aio-libs/aiopg/issues/46/events","html_url":"https://github.com/aio-libs/aiopg/issues/46","id":56317077,"number":46,"title":"Unable to do multi-insert according to docs","user":{"login":"housleyjk","id":5325564,"avatar_url":"https://avatars.githubusercontent.com/u/5325564?v=3","gravatar_id":"","url":"https://api.github.com/users/housleyjk","html_url":"https://github.com/housleyjk","followers_url":"https://api.github.com/users/housleyjk/followers","following_url":"https://api.github.com/users/housleyjk/following{/other_user}","gists_url":"https://api.github.com/users/housleyjk/gists{/gist_id}","starred_url":"https://api.github.com/users/housleyjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/housleyjk/subscriptions","organizations_url":"https://api.github.com/users/housleyjk/orgs","repos_url":"https://api.github.com/users/housleyjk/repos","events_url":"https://api.github.com/users/housleyjk/events{/privacy}","received_events_url":"https://api.github.com/users/housleyjk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-03T00:44:13Z","updated_at":"2015-02-03T20:02:53Z","closed_at":"2015-02-03T20:02:53Z","body":"The following code should work according to http://aiopg.readthedocs.org/en/stable/sa.html#aiopg.sa.SAConnection.execute:\r\n```python\r\nimport asyncio\r\nfrom aiopg.sa import create_engine\r\nimport sqlalchemy as sa\r\n\r\n\r\nmetadata = sa.MetaData()\r\n\r\ntable = sa.Table(\r\n    'table',\r\n    metadata,\r\n    sa.Column('id', sa.Integer, primary_key=True),\r\n    sa.Column('value', sa.String(255)),\r\n)\r\n\r\n\r\n@asyncio.coroutine\r\ndef go():\r\n    engine = yield from create_engine('postgresql://localhost/aiopg_issue')\r\n\r\n    with (yield from engine) as conn:\r\n        yield from conn.execute(\r\n            table.insert(),\r\n            {\"id\": 1, \"value\": \"v1\"},\r\n            {\"id\": 2, \"value\": \"v2\"},\r\n        )\r\n\r\n        res = yield from conn.execute(table.select())\r\n        for row in res:\r\n            print(row.id, row.val)\r\n\r\n\r\nloop = asyncio.get_event_loop()\r\nloop.run_until_complete(go())\r\n```\r\n\r\nHowever, I get a `aiopg.sa.exc.ArgumentError: Don't mix sqlalchemy clause and execution with parameters` error because of the dictionaries passed to execute. Are the docs out of date?"},"comment":{"url":"https://api.github.com/repos/aio-libs/aiopg/issues/comments/72723285","html_url":"https://github.com/aio-libs/aiopg/issues/46#issuecomment-72723285","issue_url":"https://api.github.com/repos/aio-libs/aiopg/issues/46","id":72723285,"user":{"login":"asvetlov","id":356399,"avatar_url":"https://avatars.githubusercontent.com/u/356399?v=3","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T20:02:53Z","updated_at":"2015-02-03T20:02:53Z","body":"Multi-insert are disabled (psycopg2 doesn't support the feature in async mode), docs are cleaned up to don't mention the feature.\r\n\r\n`SAConnection.execute` now accepts dict, list, tuple, named and positional params for specifying row data in INSERT SQL statement.\r\n\r\nReleased in 0.6.1"}}