entgamers-database
TypeScript icon, indicating that this package has built-in type declarations

0.0.16 • Public • Published

EntGamers Database

EntGamers Database is a library to unify Sessions & Database

Installation

npm install entgamers-database

Or

yarn add entgamers-database

Or

pnpm add entgamers-database

Or

bun add entgamers-database

Development

Install

bun install

Create a Migration

bun run prisma:migrate:dev --name <migration_name>

Publish a Version

To publish a version you must create a tag in your Git repository.

Usage

Environment Variables

To use EntGamers Database in projects you must set the following environment variables:

  • DATABASE_URL - Database URL
  • NEXT_PUBLIC_APPWRITE_ENDPOINT - Appwrite endpoint, since the
  • NEXT_PUBLIC_APPWRITE_PROJECT_ID
  • APPWRITE_API_KEY - Appwrite API key

Since in the community all websites are made with NextJs we apply their convention to make the required environment variables public to be accessed from the frontend.

Usage In Development

// package.json
 "scripts": {
  "prisma:generate": "prisma generate --schema=./node_modules/entgamers-database/prisma/schema.prisma",
  "prisma:db:push": "prisma db push --schema=./node_modules/entgamers-database/prisma/schema.prisma",
  "prisma:migrate:reset": "prisma migrate reset --schema=./node_modules/entgamers-database/prisma/schema.prisma",
 }
// ...

where:

  • prisma:generate - Generate Prisma Client
  • prisma:db:push - Push Prisma schema state to development database
  • prisma:migrate:reset - Reset database to the latest migration state

Usage In Production

// package.json
 "scripts": {
  "prisma:generate": "prisma generate --schema=./node_modules/entgamers-database/prisma/schema.prisma",
  "prisma:migrate:deploy": "prisma migrate deploy --schema=./node_modules/entgamers-database/prisma/schema.prisma",
 }
// ...

where:

  • prisma:generate - Generate Prisma Client for production
  • prisma:migrate:deploy - Deploy Prisma schema state to production database

Readme

Keywords

none

Package Sidebar

Install

npm i entgamers-database

Weekly Downloads

4

Version

0.0.16

License

none

Unpacked Size

50.6 kB

Total Files

39

Last publish

Collaborators

  • srjuggernaut