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

Revised design for table type #47

Closed
jclark opened this issue Mar 26, 2019 · 8 comments
Closed

Revised design for table type #47

jclark opened this issue Mar 26, 2019 · 8 comments
Assignees
Labels
enhancement Enhancement to language design lang Relates to the Ballerina language specification status/inprogress Fixes are in the process of being added Type/Proposal Lang spec proposals

Comments

@jclark
Copy link
Collaborator

jclark commented Mar 26, 2019

There's a discussion here:

https://groups.google.com/forum/#!msg/ballerina-dev/b4GM_sGXA64/GJV75EaCGQAJ

@jclark jclark added enhancement Enhancement to language design lang Relates to the Ballerina language specification labels Mar 26, 2019
@jclark jclark added this to the 2019Rn milestone Apr 17, 2019
@jclark
Copy link
Collaborator Author

jclark commented Apr 30, 2019

A few more issues:

  • Restriction on primary keys being simple could potentially be lifted by using frozen values or cloning
  • Frank commented on the Google Docs about the significance of column order. I checked the SQL spec and he was right. Columns in SQL are ordered.
  • We should consider spreadsheets use case (Pyret emphasizes this).
  • How do we write the type that contains all values of basic type table?
  • Should we add back table<T> syntax? One reason for getting rid of it was open/closed record issue.
  • Maybe also consider NoSQL use case (perhaps open records make more sense here).
  • Need to define some built-in methods.

@jclark
Copy link
Collaborator Author

jclark commented May 20, 2019

We will also need to

  • add a lang.table module
  • define how value:toString works for table values

@jclark
Copy link
Collaborator Author

jclark commented Jul 31, 2019

See issue #286 for a proposal that covers these.

@jclark
Copy link
Collaborator Author

jclark commented Feb 29, 2020

It is clear that the approach of the proposal in #286 is not the right approach. We need an approach that does not clone tables. This will need a fresh proposal.

In the meantime, we have a query feature that is not table specific (see #398, #340), and we have streams #406, which cover the iterator-type usage of tables in the existing implementation.

We are no longer trying to make a table be a transparent proxy for an SQL table. This is inconsistent with Ballerina's approach to network error handling.

jclark added a commit that referenced this issue Mar 8, 2020
@jclark
Copy link
Collaborator Author

jclark commented Mar 8, 2020

There is now a new proposal.

@jclark jclark changed the title Stabilize design of tables Revised design for table type Mar 8, 2020
jclark added a commit that referenced this issue Mar 8, 2020
@jclark
Copy link
Collaborator Author

jclark commented Mar 30, 2020

We can split the changes into the following:

  • Add new table type descriptor [done]
  • Add new table constructor [done]
  • Add new table langlib module [done]
  • Type of anydata changes to allow table<map<anydata>> not arbitrary table [done]
  • Allow query-expr to start with a table and a key-specifier [done]
  • Define value:toString for tables [done]
  • Make member access expressions work for table [done]
  • Make t[x,y] be sugar for t[[x,y]] [done]
  • Fix introductory text at beginning of structures section [done]

@jclark jclark added the status/inprogress Fixes are in the process of being added label Mar 30, 2020
jclark added a commit that referenced this issue Mar 30, 2020
Should be `table<map<anydata>>`.
Part of #47.
jclark added a commit that referenced this issue Mar 30, 2020
Part of #47.
Rewrite section on table-type-descriptor.
Rewrite section on table-constructor.
jclark added a commit that referenced this issue Mar 31, 2020
jclark added a commit that referenced this issue Mar 31, 2020
jclark added a commit that referenced this issue Apr 1, 2020
jclark added a commit that referenced this issue Apr 1, 2020
jclark added a commit that referenced this issue Apr 1, 2020
jclark added a commit that referenced this issue Apr 1, 2020
jclark added a commit that referenced this issue Apr 8, 2020
jclark added a commit that referenced this issue Apr 8, 2020
jclark added a commit that referenced this issue Apr 8, 2020
@jclark
Copy link
Collaborator Author

jclark commented Apr 8, 2020

User control over duplicate keys in a query-expr that creates a table is a separate issue #481.

jclark added a commit that referenced this issue Apr 9, 2020
To handle new table design.
Part of #47.
@jclark
Copy link
Collaborator Author

jclark commented Apr 9, 2020

Made the iterator problem be a separate issue #485.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to language design lang Relates to the Ballerina language specification status/inprogress Fixes are in the process of being added Type/Proposal Lang spec proposals
Projects
None yet
Development

No branches or pull requests

2 participants