Learn how to provision and interact with a backend data from code in a jiffy using Prisma + graphql!
Prisma is an open-source ORM for Node.js and TypeScript. It is used as an alternative to writing plain SQL, or using another database access tool such as SQL query builders (like knex.js) or ORMs (like TypeORM and Sequelize). Prisma currently supports PostgreSQL, MySQL, SQL Server, SQLite, MongoDB and CockroachDB (Preview).
What is a database?
A database is a tool used by developers to store and manage data for their applications. Think of it as a large electronic filing cabinet where you can store information and retrieve it quickly and easily. Databases are an essential component of many modern applications, from simple websites to complex enterprise systems.
There are many different types of databases, but they all share some common features. At its core, a database consists of one or more tables that store information in a structured way. Each table contains rows and columns, with each row representing a single record and each column representing a specific piece of information about that record.
Databases are used to store and manage all types of data, such as customer information, financial transactions, and inventory records. They are also used to track user activity, store log files, and manage security credentials.
In addition to storing data, databases can also perform a wide range of operations on that data, such as searching, sorting, filtering, and aggregating. This makes it easy for developers to extract the information they need from the database and use it in their applications.
Overall, databases are an essential tool for developers who need to store and manage large amounts of data in a structured and efficient way. They help developers build more powerful, flexible, and scalable applications that can handle a wide range of use cases and data types. If you are new to development, it's important to understand how databases work and how to use them effectively to build robust and reliable applications.
Anatomy of the database
Setup the backend side
Start the services
To view the output and logs of the services run:
To stop viewing the logs press CTRL
+ C
on windows or CMD
+ C
on mac.
Variables
Name | Value |
---|---|
Admin web UI | http://localhost:5050 |
Connection string | postgres://fullstack.college:fullstack.college@localhost:5432 |
Hostname | localhost |
Port | 5432 |
Username | fullstack.college |
Password | fullstack.college |
See also
Setup the application side
Installation
Initialization
Initialize a prisma.schema
file:
Configuration
Tell prisma what database to use and connect to: