ontodev / valve.rs

A lightweight validation engine written in rust.
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Add support for "readonly" tables #83

Closed jamesaoverton closed 3 weeks ago

jamesaoverton commented 4 months ago

Similar to #81 and #82, I think there's room for a "readonly" mode. A readonly table would be a physical SQL table that VALVE would load from a TSV file, but would not be editable.

  1. in the "table" table the "path" for a readonly must point to a TSV/CSV file
  2. VALVE will not create any SQL tables or views related to the readonly table, i.e. *_conflict or *_view
  3. VALVE will not save the readonly table, but it will create, drop, truncate, and load it
  4. VALVE will not edit rows in the readonly table with insert_row, delete_row, etc.
  5. it would be nice if VALVE could still validate a row from a readonly table using validate_row(), since its columns will be defined

I feel like I'm running together two use cases here:

  1. VALVE does everything it normally does, including validation and *_conflict, but does not edit rows or save
  2. VALVE just loads a plain table, without creating a *_conflict table; maybe it validates, but it can't handle conflicts

My actual use case is just loading large tables quickly, without need for validation or handling conflicts, so they can be used by other tables that are editable.

jamesaoverton commented 4 months ago

Let's focus on the use case in the final paragraph: fast loading from TSV/CSV without validation. This should be quite similar to #82, with the difference that VALVE reads the TSV into the database. We'll worry about the rest later.

lmcmicu commented 4 months ago

Update: See this comment on issue #81.