- The @discord-factory/storage module allows you to use a MySQL, PostgreSQL or SQLite database without using an API to make some data persistent. -
-- When you develop an application with a discord bot, you will need to regularly store values in order to share them globally with the application. -
-- To solve this problem, we have designed a module that simplifies the use of databases such as MySQL, PostgreSQL or SQLite. This module is based on TypeORM. - No more endless lines of code and welcome to modernity, thanks to the storage module you will be able to simplify your life in the creation of a database relationship. -
- -- To be able to use the module, you must have installed it beforehand by following the explanations below : -
-or
-- In order to use the module, you will need to start it at the same time as your application through the providers. -
-- Now that the installation is done, we will have to configure the appropriate driver for your use : -
-or
-or
-or
-
- Once the driver is configured, we will detail the functionality of the module, inspired by the
- You will say to me that a model or a migration? -
-- A model is a representation of your table that you can call via its object on your code to use CRUD (Create, Read, Update or Delete). -
-- To create a model, simply run the factory make:file command and select `model` -
-- Now that the model representing your table is created, we need to create the corresponding migration to create the table and its columns in your database. -
-- Identique aux migrations de AdonisJS il est assez facile de comprendre son fonctionnement : -
-- Once this is understood, it is fairly easy to create a migration using the framework. -
-- To create a migration, simply run the factory make:file command and select migration. - Next, choose the type of file migration and answer the question and answer set that is presented to you. One of the questions will ask you to create or modify a table, if your table has not yet been created, please select Create Table. -
-- Transfer your migrations to the database. -
-- Remove the migrations from the database. -
-- The computer acronym CRUD designates the four basic operations for data persistence, in particular the storage of information in a database. - These are : Create, Read, Update, Delete. -
-