I have created the following tables in postgres:
CREATE TABLE users(id varchar NOT NULL PRIMARY KEY);
CREATE TABLE aggregates(id uuid NOT NULL PRIMARY KEY, user_id varchar NOT NULL REFERENCES users(id))
Now, I am trying to insert a record into users using dapper:
use connection = new NpgsqlConnection(connectionString)
connection.Execute("insert into users (id) values (@id)", (Map ["id", id]))
where id is a string. When I run this, I get the following exception:
Npgsql.PostgresException (0x80004005): 42703: column "id" does not exist
followed by this message:
There is a column named "id" in table "users", but it cannot be referenced from this part of the query
I can insert a record using psql from the command line:
insert into users(id) values ('123');
What's the problem with my dapper code?
User contributions licensed under CC BY-SA 3.0