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

Rename composite type to structured type #338

Merged
merged 6 commits into from
Feb 25, 2024

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Feb 8, 2024

https://en.wikipedia.org/wiki/Structured_type

  • Rename composite type to structured type according to SQL standard (Oracle and MSSQL also support this).
  • Remove Composite folder
  • Add function's FQNs

PgSQL: CREATE TYPE typename AS (...); -- Composite type
A composite type represents the structure of a row or record; it is essentially just a list of field names and their data types.
Whenever you create a table, a composite type is also automatically created, with the same name as the table, to represent the table's row type.

Oracle: CREATE TYPE typename AS OBJECT (...); -- Nested Table Type | Object Type

MSSQL: CREATE TYPE typename AS TABLE (...); -- Table type
In user-defined table types, structured user-defined types that are used in column_name are part of the database schema scope in which the table type is defined.

MariaDB: COLUMN_CREATE(...) -- Dynamic Columns
https://mariadb.com/kb/en/dynamic-columns/

SQL Standart: 4.6.4.3 Structured types
A structured type is a named, user-defined data type. An attribute is a named component of a structured type.
Each attribute of a structured type has a data type and a default value.

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues -

Copy link

what-the-diff bot commented Feb 8, 2024

PR Summary

  • Renamed Various Files and Methods
    From "CompositeExpressionBuilder" to "StructuredExpressionBuilder", "compositeExpression" to "structuredExpression", and "compositeParser" to "structuredParser". This change in terminology will be more intuitive and consistent across our codebase.

  • Type Hint Changes in Various Methods
    Several methods have updated type hinting from CompositeExpression to StructuredExpression. This ensures code accuracy and promotes the new structure standard.

  • Renamed Database Table and Related Constants
    Changed the title of type currency_money_composite to currency_money_structured and range_price_composite to range_price_structured to promote new naming convention. The table test_composite_type was also renamed as test_structured_type, making our database schema more unified.

  • Various Codebase Updates to Adopt Structured Types Instead of Composite Types
    Several files, methods, and test classes have been updated to use structured types instead of composite types. This transition helps to maintain uniformity and improve code readability.

  • Tests Addition and Update for the New Structured Types
    Added new test cases to verify the function of StructuredExpression and StructuredParser. Existing tests have been updated to validate the use of new structured types.

  • Revision of Fixture Files to Reflect Changes
    The program has made changes to the pgsql.sql fixture files to reflect the changes made across the entire codebase. This helps maintain the consistency of our test environments.

Through these changes, we are building more structured, organized, and readable code, mirroring our attempt to adhere to better coding standards.

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a023a09) to head (8101947).

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #338   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       241       241           
===========================================
  Files             16        16           
  Lines            694       694           
===========================================
  Hits             694       694           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Tigrov Tigrov added the status:code review The pull request needs review. label Feb 8, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
@vjik vjik merged commit 0c5ad2e into master Feb 25, 2024
36 checks passed
@vjik vjik deleted the rename-composite-to-structured-type branch February 25, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants