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

EPIC: Native Types #30

Closed
janpio opened this issue Sep 6, 2019 · 4 comments
Closed

EPIC: Native Types #30

janpio opened this issue Sep 6, 2019 · 4 comments
Assignees
Labels
tech/engines/other Issue in the engines repo that does not fit one of the other labels. tech/engines Issue for tech Engines.
Milestone

Comments

@janpio
Copy link
Contributor

janpio commented Sep 6, 2019

Product Epic: The corresponding product epic can be found here.

Description: The Prisma Schema Language allows the user to define custom types that should be used for a given field.

Example:
The following example shows a User model where the combination of firstName and is backed by a varchar column.

datasource pg1 { 
  .. 
}

model User {
  id        String @default(cuid())
  firstName String @pg1.varchar(123)
  lastName  String
}

Links to actual Work Packages

@mavilein mavilein changed the title Custom Types EPIC: Custom Types Sep 25, 2019
@mavilein
Copy link
Member

mavilein commented Sep 26, 2019

Initial break down of Work Packages

  • general
    • map out all custom types of the supported databases. Map them to Prisma Core primitive types.
  • Datamodel Parser
    • extend Field data structure in dml module to store informations on custom types
    • implement new DirectiveValidator for custom types that must be part of the Datasource interface
    • test cases:
      • basic happy path
      • use invalid type for a database type
  • Migration Engine
    • core: implement new algorithm to diff custom directives. This will require us to rewrite the complete diffing logic. This will diff the ast than the dml data structures. This will lead to a breaking change of the structure of the steps.json.
    • sql connector:
      • calculation of sql schema
      • diffing of sql schemas
      • add SQL rendering to database step applier
  • Query Engine
    • We probably need to implement some kind of value coercion here. This is needed to e.g. coerce the value of a field like field String @pg.json from the underyling json type to String.
    • This will require significant work for the InternalDatamodel and the DatamodelConverter. We will have to work on bringing the InternalDatamodel and the dml::Datamodel closer together.
  • Introspection Engine:
    • core: no work required
    • connector:
      • verify that the sql-schema-describer can handle compound custom types
      • adapt Datamodel calculation so that custom types are put into the model
  • Language Tools:
    • the connector must expose the available FieldTypeConstructors
    • create an interface that can be consumed by the vs code plugin (consider adding it to MCF)
    • implement auto completion

@mavilein

This comment has been minimized.

@yoshuawuyts yoshuawuyts changed the title EPIC: Custom Types EPIC: Native Types Jul 21, 2020
@mavilein mavilein self-assigned this Aug 6, 2020
@mavilein mavilein added this to the Milestone 2.5.0 milestone Aug 6, 2020
@mavilein mavilein added the tech/engines Issue for tech Engines. label Aug 18, 2020
@janpio janpio modified the milestones: Milestone 2.5.0, Backlog 2.6.0 Aug 18, 2020
@mavilein mavilein added the tech/engines/other Issue in the engines repo that does not fit one of the other labels. label Sep 1, 2020
@janpio janpio modified the milestones: Backlog 2.6.0, Backlog 2.7.0 Sep 1, 2020
@janpio janpio modified the milestones: Backlog 2.7.0, Backlog 2.8.0 Sep 16, 2020
@janpio janpio modified the milestones: Backlog 2.8.0, Backlog 2.9.0 Sep 29, 2020
@do4gr
Copy link
Member

do4gr commented Feb 17, 2021

Native types got stabilized in 2.17!

@do4gr do4gr closed this as completed Feb 17, 2021
@Jolg42 Jolg42 modified the milestones: 2.12.0, 2.17.0 Feb 17, 2021
@Jolg42
Copy link
Contributor

Jolg42 commented Feb 17, 2021

miguelff pushed a commit that referenced this issue Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech/engines/other Issue in the engines repo that does not fit one of the other labels. tech/engines Issue for tech Engines.
Projects
None yet
Development

No branches or pull requests

5 participants