Skip to content

Instantly share code, notes, and snippets.

@VegarRingdalAibel
Created June 17, 2022 11:23
Show Gist options
  • Select an option

  • Save VegarRingdalAibel/8d6c44272bb030c8c2fd0997d7ca3e07 to your computer and use it in GitHub Desktop.

Select an option

Save VegarRingdalAibel/8d6c44272bb030c8c2fd0997d7ca3e07 to your computer and use it in GitHub Desktop.
web.update

web-update

Simple as possible where view have all config, just generate view and column and you DONE, no other table/config etc.. KISS (KEEP IT SIMPLE STUPID )

Columns types:

  • W_* = writable columns, W_ will not be shown in GUI/GRID
  • R_* = readonly columns, R_ will not be shown in GUI/GRID , but stop user for editing column
  • RG_ = writable in api, but only read in grid
  • WO_*, RO_*, RGO_, same as first part, only not displayed by default (need to use column chooser to find)
  • WH_*, RH_*, But hidden, maybe column you dont want user to see, but you need it due to realational data
  • M_* = meta column, not for data, but config, this is read before call to database is done, so user cant modify it to inject, not show in GUI/GRID, only fetch once per update/select
  • Other : columns without W_, R_, M_ we be automatically writable (including hidden/optional)

M_columns:

  • M_PK_COLUMN_NAME = Everything after M_PK_ is column name of primary key column, every view need to include this to allow Create/Update/Delete operations
  • foreign key, needed to split up to keep well inside 128byte column size
    • M_FKC_COLUMN_NAME__FROM_COLUMN__TO_COLUMN....from/to...from/to , foreign keys,
    • M_FKT_COLUMN_NAME__TITLE_YOU_WANT title for foreign keys
    • M_FKV_COLUMN_NAME__VIEW_TO_USE view to use
  • M_MOD_COLUMN_NAME column is modified column, use for smarter update after save, query whats changed since last fetch
  • M_BOOL_COLUMN_NAME__TRUE__FALSE boolean column, first is column name, next is true value, and false value
  • M_ALLOW_DELETE need to be added to allow delete in backend and frontend - not sure yet about this..
  • M_ALLOW_INSERT need to be added to allow insert in backend and frontend - not sure yet about this..
  • M_COPY_COLUMN_NAME__OTHER_COLUMN__OTHER_COLUMN force grid to copy also other columns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment