databases icon indicating copy to clipboard operation
databases copied to clipboard

Differing results

Open ahopkins opened this issue 5 years ago • 0 comments

I am playing around with this project (making a wrapper around it) and came across an odd behavior.

Using the example on the README:

The following two queries do not provide the same result:

query = "SELECT id, name FROM Players ORDER BY name"
async for row in database.iterate(query=query):
    print(row)

print("---")

query = "SELECT id, name FROM Players ORDER BY :order_by"
async for row in database.iterate(
    query=query, values={"order_by": "name"}
):
    print(row)

The output:

(3, 'Carol')
(1, 'Daisy')
(2, 'Neil')
---
(1, 'Daisy')
(2, 'Neil')
(3, 'Carol')

ahopkins avatar Apr 25 '20 21:04 ahopkins