burggraf / pb-import

Import to Pocketbase
14 stars 1 forks source link

Import from JSON #2

Open kerimovok opened 7 months ago

kerimovok commented 7 months ago

Are you planning to add support for JSON?

This tool is awesome!

burggraf commented 7 months ago

Can you elaborate on what you're looking for, exactly?

kerimovok commented 7 months ago

Ability to import data from JSON file

[
{
    name: "Product",
    quantity: 50,
    price: 15.40,
    categoryId: 10,
    productId, 12,
    properties: {
        length: 12,
        color: 1020,
        ...
    },
},
...
]
name quantity productId ... properties
"Product" 50 12 ... {length: 12, color: 1020}

Or will it be easier to convert JSON to CSV, then use pb-import?

burggraf commented 7 months ago

It would be easier to convert to CSV, I think. JSON can be unstructured, and would be a little more difficult to support. It's doable, but if you can flatten this to CSV that's the quickest way to get this done.