Code Monkey home page Code Monkey logo

simple.data.postgresql's Introduction

NuGet status Build status

Simple.Data.NpgSql

An adapter to PostgreSql databases for Simple.Data

Use

The adapter makes use of the Npgsql open source database adapter.

To use this adapter, you will need to add the provider name to your app.config or web.config file:

<system.data>
  <DbProviderFactories>
    <add name="Npgsql Data Provider"
         invariant="Npgsql"
         support="FF"
         description=".Net Framework Data Provider for Postgresql Server"
         type="Npgsql.NpgsqlFactory, Npgsql" />
  </DbProviderFactories>
</system.data>

PostgreSql Types

The adapter is currently tested for all basic PostgreSql types documented in 9.0, including ARRAY types and refcursor types.

Procedures that return refcursor are not yet supported.

User defined types will be returned as generic objects.

TODO: Investigate adding support for PostGIS types

Identity column

PostgreSql does not support explicitly stating that a column is an identity column. This adapter chooses the first column in the table that is not nullable, and that has an auto-incrementing default value (i.e., the column's default value is nextval()). This can be either handled implicitly using PostgreSql's serial or bigserial type or explicitly using PostgreSql's integer or bigint type and a sequence.

If there are multiple auto-incrementing columns, this adapter will use the first as the identity column.

Timestamps

.NET's DateTime does not appear to handle PostgreSql's timestamp with time zone and time with time zone types. Either that or I don't understand how to use it properly. In either case, I would recommend you stick to the timestamp and time (without time zone) types or results may be unexpected.

I'm not sure yet whether this is a PostgreSql issue or an Npgsql issue. More likely the latter.

TODO: Investigate using Npgsql's NpgsqlTimestamp type.

Testing

The default tests assume a database cluster installed at localhost:5432. Tests assume that the superuser account is named 'postgres' with password 'postgres' and that there is a default database named 'postgres'. If your system is not set up like that, all these settings can be changed in the app.config file.

simple.data.postgresql's People

Contributors

chris-hogan-logikos avatar chrismh avatar maniserowicz avatar pako1337 avatar yartat avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.