I am writing some code that will prepare my database for my application. In the code there are some repetitive SQL statements when I am creating a table, and I want to hide them in some methods (there are only two for now: creating the primary key and mak...
If I define a boolean data type in a Postgres table and query from it, the results for the boolean columns come back as "t" or "f"....I'm using NPGSQL as my driver and Dapper as a ORM. This causes a problem because Dapper is unable to convert "t" or "f" i...
I was trying dapper orm and recently they added asyncquery support. I googled it about that. It is wonderful if you have heavy traffic on your site. I was trying that with postgressql and dapper. Now, in connection if I am passing simple connection string...
Dapper (1.13 Noobget Package) creates different SQL statements depending on if it's used with a plain ADO.NET database connection or with a decorated mini-profiler database connection....Example code (tested with Postgresql)...Usings:...using System.Linq;...
Given this table structure:...CREATE TABLE tags
(
id SERIAL NOT NULL PRIMARY KEY,
tagname TEXT NOT NULL UNIQUE,
authorid int NOT NULL,
created timestamp NOT NULL,
lastmodified timestamp NOT NULL,
constraint fk_authorid_tags foreign key(author...
I'm currently investigating a problem with executing an insert using Dapper's Execute in conjunction with the Npgsql2 managed provider for PostgreSQL 9.3....Table Structure (simplified):...CREATE TABLE posts
(
id SERIAL NOT NULL PRIMARY KEY,
title TEX...
I am attempting to run some commands in a transaction using Npgsql 2.1.3 (Postgres v9.3) and Dapper 1.29, but am occasionally getting some unexpected exceptions. Sometimes, the code works just fine. Other times, I am getting the following exception:...N...
I am attempting to perform a bulk-insert using Dapper over Npgsql, that returns the ids of the newly inserted rows. The following insert statement is used in both of my examples:...var query = "INSERT INTO \"MyTable\" (\"Value\") VALUES (@Value) RETURNIN...
I'm trying to use dapper to parameterize a postgres anonymous function i've written to do an upsert. Here's the code:...private static int UpsertProductPrice(
IDbConnection connection,
Data.ProductPrice price,
List<Data.ProductPric...
I have enumerated types in Postgres, defined as follows:...CREATE TYPE "SomeEnumType" AS ENUM (
'Val1',
'Val2'
);
...I have the equivalent enum defined in C#:...public enum SomeEnumType {
Val1,
Val2
}
...When I updated to Npgsql v3.0.0, de...
This issue appears to be with something in Npgsql 3.0.0 that changed from under Dapper 1.42. I came to that conclusion since the following code used to work when using Npgsql 2.2.3 with the same version of Dapper:...public struct MyStruct
{
private r...
Npgsql supports parsing ...System.Net.NetworkInformation.PhysicalAddress... and ...System.Net.IPAddress... from query result sets of type ...macaddr... and ...inet..., respectively. For example, the following class can be populated using Npgsql with Dap...
I am having this ...phantom... problem in my application where one in every 5 request on a specific page (on an ASP.NET MVC application) throws this error:...Npgsql.NpgsqlException: ERROR: 57014: canceling statement due to user request
at Npgsql.Npgsql...
I have an array of strings, and I'd like to have a query containing an IN clause, like:..."... WHERE t.name IN ('foo', 'bar', 'baz')..>"
...Here's the final bit of my query, which contains a "where X in Y" clause:......
left join genre_tag_band_join tj on...
I try to fetch an execution plan from Postgresql via Npgsql and Dapper....And versions of used software.....Net Framework 4.6.1...ASP.NET WebAPI 2...Postgresql 9.4...Npgsql v3.0.5...Dapper v1.42.0...Non-EXPLAIN query with IN-clause with List<int> can fetc...
I am basically running a sql query through dapper but when I do some profiling on this on every query that i perform to npg sql I see an extra ...ExecuteScalar... query that is sent on that connection. And there are multiple ...NpgsqlConnection.Close... e...
I'm trying to use Npgsql and/or Dapper to query a table and I keep running into ...Npgsql.PostgresException 42601: syntax error at or near "$1"....Here is what I've got trying it with NpgsqlCommand:... using (var conn = new NpgsqlConnection(System.Config...
From NuGet, I am using......\packages\Npgsql.2.2.5\lib\net45\Npgsql.dll......\packages\Dapper.1.42\lib\net45\Dapper.dll...In calling a stored procedure in PostgreSQL, I have need to preserve the ...case of the procedure name... as...var x = cnn.Query<icd9...
I have a postgresql database that was created with "SQL_ASCII" and template "template0". It holds data in Portuguese so I have data such as "Não", "Feijão", "Avô". When I try to retrieve rows that have these kind of characters "~^" it does not work, ot...
I'm not sure if there is a way to support this, but I'm having trouble getting Dapper to map string parameter values to the Postgresql citext data type as it seems to be using the text type....In particular, I'm trying to call a function that takes in cit...