Comments (4)
From ChatGPT:
Custom Attributes on Entities and Fields
Custom attributes are a powerful feature that provides you with the flexibility to add additional metadata or functionality to your entities and fields. They allow for a higher level of customization and control, enabling you to tailor the behavior of your entities and fields to best fit your specific needs.
Adding Custom Attributes to Entities
You can add custom attributes to entities by using a simple command format: '@@command([parameters])'.
In this command, replace 'command' with the operation you wish to perform (e.g., 'map'), and 'parameters' with the parameters required for your chosen operation.
For example, if you wanted to create a mapping for an entity named 'users', your command would look like this: '@@Map('users')'.
Adding Custom Attributes to Fields
Similarly, you can also add custom attributes to fields using a similar command format: '@command([parameters])'.
In this format, replace 'command' with your desired operation (e.g., 'index'), and 'parameters' with the appropriate parameters for that operation.
As an example, if you wanted to index a field named 'username', you would use the following command: '@Index('username')'.
Notes
- Remember that custom attribute commands are case-sensitive.
- Ensure your parameters are correctly formatted. For instance, if your operation requires multiple parameters, they should be enclosed in brackets and separated by commas. (example: '([parameter1, parameter2, ...])')
Custom attributes offer an efficient and effective way to enhance your data structure, enabling you to optimize the way you manage, search, and interact with your data. With this feature, you can build systems that are more streamlined, adaptable, and aligned with your unique needs.
from docs.
Please see the relevant prisma documentation:
https://www.prisma.io/docs/concepts/components/prisma-schema/data-model
And in particular these sub-sections:
https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#defining-attributes
https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#native-types-mapping
from docs.
entity field attributes:
NOTE: There are field attributes such as fields: [fieldName], references: [referenceField]
and @unique
that we already add when a relation is set or the toggle is on
Therefore, the user should be aware of not adding relation attribute where we already added, or add the relation at the other side and then his/her prisma schema will not be valid
model field attributes:
from docs.
This one is taken care of in #310.
from docs.
Related Issues (20)
- Redo Documentation FAQs
- Build a Feedback Component To Add Another Feedback Source
- Update the mentions of trial period from 14 days to 7 days
- SAML - new plugin HOT 1
- Documentation for Plugins Experience phase 2
- Documentation for Custom Actions and Types (phase 2)
- Create blogpost, and emails for the Custom Actions release
- Update the documentation to remove the beta mentions for the BTM
- Documentation for the Analytics Dashbord HOT 1
- Redo Amplication's Getting Started Page
- Update the documentation to reflect our .NET capabilities HOT 1
- Amplication AI / Jovu- Update the docs to reflect the AI revolution HOT 1
- Amplication AI / Jovu: Blogpost and Email to our users HOT 1
- "Bug": Update the smart-git-sync page HOT 1
- Update the Contact-us link in our documentation
- Authentication Entity's Settings: Further elaborate it in the docs page
- Blogpost for .NET support HOT 1
- Email to users regarding .NET support
- Resolve Git Connection Issues Page HOT 1
- Update Authentication Entity Documentation for .NET and Node.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.