-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Design for List data type #978
Comments
Assigned to @ghislaineguerin to review. @ghislaineguerin when this looks good, please change label to |
|
In Tables, users will be entering list data in individual cells manually, they will not be generating lists from other cells. When we use lists in Views, users will be generating data from other cells but that is out of scope here and will be handled in a separate design issue.
No, all list items for a single column will be the same data type.
No, all list items in a single list will have the same data type.
Lists in Mathesar are called Arrays in PostgreSQL and you can read about them here: https://www.postgresql.org/docs/13/arrays.html Mathesar won't be supporting all functionality in PostgreSQL, just a subset. But everything in Mathesar is built on top of existing PostgreSQL feature. |
@kgodey Thanks for your reply!
In other words, users only need to configure the entire column data type at once? |
Users will need to pick the List data type first and then configure the data type of list items once they have picked that. But all the configuration should take place at once, yes. |
@ghislaineguerin mentioned that additional examples of where users might use list data types could be useful. Here are some:
I hope this is helpful @ppii775 |
@ppii775 Also, please note that this issue does not deal with nested lists (Lists of Lists, or Lists of Lists of Lists, or so on). Although PostgreSQL does support column types that nest lists, creating a UI that works well for nested lists is not within scope of our initial release. You can ignore that use case for your work on this issue. |
Thanks @kgodey |
Yes, that's accurate.
The creation scenarios are:
We don't need to do anything related to aggregating other data for this issue. Does that answer your questions? |
This is out of date, I'm going to close it. We'll create a new issue once we have better requirements. |
Problem
So far, we've been assuming that users will only store a single point of data in any given table "cell". However, PostgreSQL (the database we use) supports the ability to store a list instead of a single point of data.
Lists will be useful in both Tables and Views.
Lists in Tables
As an example, see this table that stores the mapping between movies and actors:
Here,
Actor
is aText
field. If we instead wanted to store a table like so:We would need to set the data type of
Actors
to be aList
ofText
types instead.This is not actually the ideal structure for this data (you can see that
Meryl Streep
is repeated in both records), for the ideal structure, see the tables listed in this wiki page and the Foreign Key constraints spec. However, we still want to support Lists since it's an underlying database feature and it might be easier to use for some use cases.Lists in Views
As described in the Product Spec for Views, columns in Views will have the same data types as Tables. Data types in Views will represent the final data type.
Please see the example view on the Views "Concepts" page on the wiki. There, the
Actors
column, which is generated from summarizing individual actors, will have a list data type.Proposed solution
Since Views are still being figured out, this issue will focus on representing Lists in tables. We will need designs for the following scenarios:
Viewing data
Setting data type
Existing data type specs (under "Additional Context") should be helpful here.
Editing List cells
3 The user can remove an item from a cell containing a List
Filtering and Grouping
<LIST ITEM DATA TYPE>
<NUMBER>
<NUMBER>
<NUMBER>
<NUMBER>
<NUMBER>
Design Notes
Additional context
The text was updated successfully, but these errors were encountered: