Skip to content

wc-code-challenges/Noiz.DataManagement.PostgresDataAdapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Noiz.DataManagement.PostgresDataAdapter

For postgresSql bulk data ingestion, this builds on https://github.com/PostgreSQLCopyHelper/PostgreSQLCopyHelper it automates the process of building a copy helper and also if need be creating a table.

To run the acceptance tests please complete the connection string at the top of the file.

Usage is as follows, see below

public ulong Save(IEnumerable<TestDataObject> entities)
{
  using var connection = new NpgsqlConnection(DbConnectionString);

  connection.Open();
  var createTableSql = PostgresBulkCopyUtility.CreatePostgresTable<TestDataObject>(Tablename);

  connection.ExecuteScalar(createTableSql);

  var mapping = PostgresBulkCopyUtility.GetPostgreSQLCopyHelper<TestDataObject>(Tablename);

  return mapping.SaveAll(connection, entities);
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages