pg-upload 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +3 -0
  2. package/index.js +1 -1
  3. package/package.json +2 -2
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { Pool } from 'pg';
2
+
3
+ export declare function upload(db: Pool, file: string, sql: string): void;
package/index.js CHANGED
@@ -2,7 +2,7 @@ import fs from 'node:fs'
2
2
  import { pipeline } from 'node:stream/promises'
3
3
  import { from } from 'pg-copy-streams'
4
4
 
5
- export async function copyIntoTable(db, sql, file) {
5
+ export async function upload(db, file, sql) {
6
6
  const client = await db.connect();
7
7
  try {
8
8
  const ingestStream = client.query(from(sql))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-upload",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Upload files to a PostgreSQL database for import",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -15,7 +15,7 @@
15
15
  "author": "Mikkel Nygaard Ravn",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "pg": "^8.12.0",
18
+ "pg": "^8.13.1",
19
19
  "pg-copy-streams": "^6.0.6"
20
20
  }
21
21
  }