An open API service indexing awesome lists of open source software.

https://github.com/prosumma/postgresqlexporter

A simple library to create PostgreSQL-friendly import files
https://github.com/prosumma/postgresqlexporter

Last synced: 8 months ago
JSON representation

A simple library to create PostgreSQL-friendly import files

Awesome Lists containing this project

README

          

### PostgreSQL Exporter

A simple library for exporting data that is compatible with PostgreSQL's `\COPY` command.

Here's a quick example:

```cs
using (var connection = new SqlConnection(ConnectionString))
{
connection.Open();
var command = connection.CreateCommand();
command.CommandText = "SELECT * FROM [Cornholios]";
using (var reader = command.ExecuteReader())
{
var exporter = new Exporter { ProgressInterval = 100000 };
exporter.Progress += (sender, e) =>
{
Console.WriteLine($"Wrote {e.Count} records.");
};
exporter.Export(reader, Environment.ExpandEnvironmentVariables("%USERPROFILE%\\Desktop\\Cornholios.tsv"));
}
}
```