Skip to content

Set endpoint fetch types using the SQL schemas directly? #229

@nmdefries

Description

@nmdefries

Original suggestion

Is there a way to query the DB directly for schema info, e.g. with a helper fn or schema endpoint? SQL DESCRIBE looks simple and has the type info we want.

Maybe we could parse the .sql files, e.g. have a script in the epidatr directory that generates a JSON file and the epidatr endpoints can read that. May be simpler to set up/touch fewer things and could always switch to the "schema" endpoint later (need to make sure the output format is the same).

Note: Endpoint data is often split across multiple tables, so any approach would need to know how to combine across those.

Unclear if doing this in an automatic way is more or less work than maintaining specs manually in epidatr. Source headers shouldn't change often/fast -- most endpoints aren't adding new fields; many aren't even being updated anymore; and covidcast at least uses the same header for every signal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2low priorityenhancementNew feature or requesttriageShould assign/revisit priority level, other tags

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions