Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend implementation of Number Mathesar type #258

Closed
Tracked by #248
kgodey opened this issue Jun 14, 2021 · 2 comments
Closed
Tracked by #248

Frontend implementation of Number Mathesar type #258

kgodey opened this issue Jun 14, 2021 · 2 comments
Assignees
Labels
ready Ready for implementation type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory

Comments

@kgodey
Copy link
Contributor

kgodey commented Jun 14, 2021

Requirements

Users should be able to:

  • view data in columns that have the Number Mathesar type
  • change data type to and from the associated DB types based on options selected
    • NUMERIC
    • SMALLINT
    • INTEGER
    • BIGINT
    • DECIMAL
    • REAL
    • DOUBLE PRECISION
  • view, set, and change data type options related to the Number data types
  • filter data by Number-specific filtering options
  • group data by Number-specific grouping options
  • use display options to view data in Number type columns
    • Numbers should be formatted according to the locale in the display option
    • If the percentage option is enabled, numbers should be shown as a percentage.
  • see Number data shown in a monospace font or using tabular figures (see design spec)

Update:

DB Type Mapping

  • New columns of UI type Number and converting existing columns to UI type Number will use NUMERIC
  • Applying database options will change DB type in the following ways:
    • Setting "Number Type" to Integer will update the DB type to INTEGER and will set "Integer data size" to 32 bits
      • Updating "Integer data size" to 64 bits will change DB type to BIGINT
      • Updating "Integer data size" to 16 bits will change DB type to SMALLINT
    • Setting "Number Type" to Decimal will leave the DB type as-is (it could be NUMERIC or DECIMAL)
      • Setting decimal place and max digits will set the precision and scale type options.
    • Setting "Number Type" to Float will change the DB type to DOUBLE PRECISION and will set "Floating Point Type" to "15 digits precision"
      • Updating "Floating Point Type" to "6 digits precision" will change DB type to REAL
  • Existing columns of the given types should automatically set the correct database options according to the logic above.
  • DECIMAL columns should be treated the same as NUMERIC columns.

Implementation

Design

Backend

  • /api/v0/tables/ lists the name and DB type of each columns
  • /api/v0/tables/<id/columns/ lists column information in more detail
  • /api/v0/databases/<id>/types/ maps Mathesar types to DB types and provides a list of filtering and grouping options per-type.
    • These should be used to populate the filter and grouping options dynamically.
  • Updates to column types and type options should happen via PATCH requests to /api/v0/tables/<id>/columns/<id>/. These updates include
    • Changes to the data type (type)
    • Changes to the data type options (type_options)
    • Changes to the display options (display_options)

Additional Context

@kgodey kgodey added type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory needs: unblocking Blocked by other work status: detail needed labels Jun 14, 2021
@kgodey kgodey added this to the 8. Initial Data Types milestone Jun 14, 2021
@kgodey kgodey removed the needs: unblocking Blocked by other work label Jun 18, 2021
@kgodey kgodey changed the title Frontend implementation of numeric data types. Frontend implementation of Number Mathesar type Sep 13, 2021
@kgodey kgodey added needs: unblocking Blocked by other work and removed status: draft labels Sep 13, 2021
@kgodey kgodey added ready Ready for implementation and removed needs: unblocking Blocked by other work labels Mar 1, 2022
@kgodey
Copy link
Contributor Author

kgodey commented Mar 1, 2022

Marking this as ready since filtering and grouping have been moved to other issues and remaining backend work is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Ready for implementation type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory
Projects
No open projects
Development

No branches or pull requests

2 participants