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

catalog-importer import #53

Merged
merged 1 commit into from
Jul 24, 2023
Merged

catalog-importer import #53

merged 1 commit into from
Jul 24, 2023

Conversation

lawrencejones
Copy link
Member

For those who want to import an existing file of data or do a one-time import, this command can help achieve that.

I've tested it against a CSV export of a Notion database. I asked the import to actually run a sync but it's equally valid not to, and to rely on the import command to generate the importer.jsonnet config that you add to your broader sync config and use whatever source files you run the import against to be the source of the data from thereon out.

The command I was using is this:

$ catalog-importer import \
  --local-file tmp/documents.csv \
  --name Documents \
  --description 'Documents from a Notion database' \
  --type-name 'Custom["Documents"]' \
  --source-external-id 'Name' \
  --source-name 'Name' \
  --run-sync \
  --run-sync-dry-run

This commit includes two broader changes which are:

  • Setting the top-level scope of a CEL expression to the underscore character
  • Providing support for CSV input files

For those who want to import an existing file of data or do a one-time
import, this command can help achieve that.

I've tested it against a CSV export of a Notion database. I asked the
import to actually run a sync but it's equally valid not to, and to rely
on the import command to generate the importer.jsonnet config that you
add to your broader sync config and use whatever source files you run
the import against to be the source of the data from thereon out.

The command I was using is this:

```
$ catalog-importer import \
  --local-file tmp/documents.csv \
  --name Documents \
  --description 'Documents from a Notion database' \
  --type-name 'Custom["Documents"]' \
  --source-external-id 'Name' \
  --source-name 'Name' \
  --run-sync \
  --run-sync-dry-run
```

This commit includes two broader changes which are:
- Setting the top-level scope of a CEL expression to the underscore
  character
- Providing support for CSV input files
@lawrencejones
Copy link
Member Author

Just realised: this'll need tuning a bit for nested JSON structures.

Probably fine to merge as is for now though.

@lawrencejones
Copy link
Member Author

Opened an issue to track the nested structure problem: #54

Will merge this as it's useful anyway.

@lawrencejones lawrencejones merged commit beff94a into master Jul 24, 2023
1 check passed
@lawrencejones lawrencejones deleted the lawrence-import-command branch July 24, 2023 09:28
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