Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Idempotent CSV Serialization #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tim-elam
Copy link

Purpose

These changes fix a few issues I ran into in my use case.

  1. Allow users to export, make a few changes, and import without creating additional entries.
  2. Enable passing undefined explicitly to allow Prisma PostgreSQL to set default values.

New Settings:

import.upsertById: Updates existing records instead of failing to create.
import.csv.undefinedValue: Provide a string to convert into null during CSV import
import.csv.nullValue: Provide a string to convert into undefined during CSV import
export.csv.undefinedValue: Provide a string to convert into undefined during CSV export
export.csv.nullValue: Provide a string to convert null into during CSV export

Demo

975f4a15-98e5-4e53-99b8-efe638ca8eab.mp4

Notes

  • Admittedly not the cleanest commit log 😅
  • I published this at [email protected] to unblock myself.

import.upsertById: Updates existing records instead of failing to create.
import.csv.undefinedValue: Provide a string to convert into null during CSV import
import.csv.nullValue: Provide a string to convert into undefined during CSV import
export.csv.undefinedValue: Provide a string to convert undefined into during CSV export
export.csv.nullValue: Provide a string to convert null into during CSV export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant