Skip to content

Can I import Javascript objects (and/or JSON) directly into a table? #577

@githorse

Description

@githorse

My API returns an array of JSON objects, which then becomes an array of Javascript objects by the time it hits my application-level code. Is there a way to load the in-memory array of Javascript objects (or, possibly, the original JSON) directly into a sql.js database table?

Obviously I can craft my own INSERT statements to do this, but the omission of a built-in loader for Javascript objects makes me think I'm missing something here. If I don't have a .sqlite file to download, but rather a JSON API (surely, not a terribly rare use case?), what's the standard practice for getting my data from that API into sql.js?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions