as_star_database function

Get a star database from a flat table