Mandarine.TS
Latest
Latest
  • Mandarine.TS
  • Getting started
    • Installing Deno Runtime
    • Setting up Environment
    • Quick Example
  • Concepts
  • Mandarine Project Structure
  • Mandarine CLI
    • CLI Reference
      • mandarine new
      • mandarine generate
      • mandarine run
  • Mandarine Core
    • Core Initialization
    • Mandarine.json
    • Dot env file
    • Properties
      • The @Value Decorator
    • Components
      • Controller
      • Middleware
      • Repository
      • Component
      • Service
      • Configuration
      • Manual Component
    • Dependency Injection
      • Accessing DI container
    • Resource Handlers
      • Resource Handler Registry
      • Resource Handler
      • Resource Resolver
  • Mandarine MVC
    • Web MVC
    • Controllers
      • Routes
        • Parameterized Routes
      • HTTP Handlers
      • @ResponseStatus
    • Custom Middleware
    • Session Middleware
    • CORS Middleware
    • Template Engine
      • @Render Decorator
      • Accessing data from template
    • Launching web-app
    • Serving Static Content
    • Multipart Form Data
  • Mandarine Security
    • Sessions
  • Mandarine Data
    • ORM
      • Data source
      • Models
      • Repositories
        • Interacting with data
        • Updating data
    • Mandarine Query Language
  • Resources
    • Changelog
  • Plugins
    • Optional
    • Promise Repeater
Powered by GitBook
On this page
  • Concepts
  • Usage

Was this helpful?

  1. Mandarine Core
  2. Components

Repository

This page summarizes the information & use of the repository component.

Concepts

  • It is part of the Mandarine Data module.

  • It works as a bridge between your database & your application layer.

  • It does not accept the use of DI, but it is injectable.

Usage

Syntax:

@Repository()

Example

import { Repository, MandarineRepository } from "https://deno.land/x/mandarinets/mod.ts";

@Repository()
abstract class MyRepository extends MandarineRepository<YourModel> {

    constructor() {
        super(YourModel);
    }
    
}

Where YourModel is the instance that represents a database table.

PreviousMiddlewareNextComponent

Last updated 4 years ago

Was this helpful?