KDb/TODOs/User data: Difference between revisions

From KDE Community Wiki
< KDb‎ | TODOs
Line 19: Line 19:
==kexi__userdata schema==
==kexi__userdata schema==
  kexi__userdata
  kexi__userdata
   d_user Text NOT NULL -- user name
   d_user Text NOT NULL             -- user name
   o_id Integer UNSIGNED NOT NULL -- n-to-1 relationship to kexi__objects.o_id
   o_id Integer UNSIGNED NOT NULL   -- n-to-1 relationship to kexi__objects.o_id
   d_sub_id Text NOT NULL -- sub-identifier of the data (not i18n'd, dependent on object type, should not be tool long)
   d_sub_id Text NOT NULL           -- sub-identifier of the data
   d_data LongText -- actual data serialized to text
                                    -- (not i18n'd, dependent on object type, should not be tool long)
   d_data LongText                 -- actual data serialized to text


Notes:
Notes:
*cascade update and delete of kexi__userdata records should happen based on kexi__objects
*cascade update and delete of kexi__userdata records should happen based on kexi__objects
*no primary key but (d_user, o_id, d_name) should be unique, so having a key would be useful
*no primary key but (d_user, o_id, d_name) should be unique, so having a key would be useful

Revision as of 09:59, 13 August 2012

Design page for task: Support for user data storage.

Rationale

Among others, this feature is needed by the Remember table column widths feature.

Requirements

  • Backward compatibility
    • Older Kexi versions should just ignore the data
  • Per user-separation
    • How: based on user name, this implies that updates are needed when user name changes
    • How: in separate table kexi__userdata
  • Backend independence - should work with the SQLite driver as well the server backends (any table-based backends)
    • How: achieved using standard db table, related to objects
  • Portability to Predicate and 100% schema-compatible with Predicate
    • How: API will change but table schema will stay the same

kexi__userdata schema

kexi__userdata
  d_user Text NOT NULL             -- user name
  o_id Integer UNSIGNED NOT NULL   -- n-to-1 relationship to kexi__objects.o_id
  d_sub_id Text NOT NULL           -- sub-identifier of the data
                                   -- (not i18n'd, dependent on object type, should not be tool long)
  d_data LongText                  -- actual data serialized to text

Notes:

  • cascade update and delete of kexi__userdata records should happen based on kexi__objects
  • no primary key but (d_user, o_id, d_name) should be unique, so having a key would be useful