Giter VIP home page Giter VIP logo

core's Introduction

ThothOM is an Object Mapper, an ORM + ODM, based on TypeORM syntax and ESLint plugable approach. Our intention here is standardize the connection and implementation of every database with the best performance possible, and for this, we use an plugable approach, so more people can contribute and create their on integration. This package alone can't do anything besides typing, the plugins do all the "dirt work".

Currently it only works with TypeScript (and transpiled JavaScript), and we plan to keep this way.

Discord Community Docs

Why use ThothOM?

  • Easy to use and standardize. Regardless of the database, the implementation will be the same in all cases (except the most complex ones).
  • The plugable approach. With the community support, this OM can work with all the databases, be they NoSQL or SQL, as long as it has a plugin for it.
  • No globals! All that this package uses is encapsuled inside it's classes, so there is no need to worry about some config defined in a global scope compromising your code, but if you want, you can use setGlobalConnection() to allow globals.
  • Free and direct support. If you have any question, you can join our discord community, and we and the members of Techmmunity will help you!
  • Focused on microservices and serverless! We focus in keep it usable for serverless and microservices projects.

Install and Config

With Yarn:

yarn add @thothom/core reflect-metadata

With NPM:

npm i @thothom/core reflect-metadata

Configure tsconfig.json:

{
	"compilerOptions": {
		"experimentalDecorators": true,
		"emitDecoratorMetadata": true,
		"skipLibCheck": true
	}
}

Plugins List

All the ThothOM Plugins have the thothom tag, so you can easily found all the plugins at this link.

Plugins List

Usage

ThothOM only supports the Data Mapper pattern, so we can avoid mutability and bad code practices.

import { Column, Entity, PrimaryGeneratedColumn } from "@thothom/core";
// All plugins export a Connection class and a Repository type
import { Connection, Repository } from "example-thoth-plugin";

@Entity()
class FooEntity {
	@PrimaryColumn()
	public id: string;

	@Column()
	public foo: string;
}

type FooRepository = Repository<FooEntity>;

const bootstrap = async () => {
	const connection = new Connection({
		// Connection config here
		entities: [FooEntity],
	});

	await connection.load();
	await connection.connect();

	const fooRepository: FooRepository =
		connection.getRepository<FooEntity>(FooEntity);

	await fooRepository.save({
		bar: "foo",
	});

	await connection.close();
};

bootstrap();

Documentation

How to contribute?

All the details about contributing are in our website.

See here our to-dos.

Special Thanks

Contributors

This project exists thanks to all the people who contribute:

COMING SOON

Cool Kids

  • A very special thanks to the creators of TypeORM, without their code, this package would never exists.

core's People

Contributors

dependabot[bot] avatar henriqueleite42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.