GithubHelp home page GithubHelp logo

typeorm.github.io's Introduction

TypeORM Documentation Website

Documention : https://typeorm.io/

Project Repo : https://github.com/typeorm/typeorm

What is TypeORM?

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap and Ionic platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7). Its goal to always support latest JavaScript features and provide features that help you to develop any kind of applications that use databases - from small applications with a few tables to large scale enterprise applications with multiple databases.

TypeORM supports both Active Record and Data Mapper patterns, unlike all other JavaScript ORMs currently exist, which means you can write high quality, loosely coupled, scalable, maintainable applications the most productive way.

TypeORM is highly influenced by other ORMs, such as Hibernate, Doctrine and Entity Framework.

Some of TypeORM features:

  • supports both DataMapper and ActiveRecord (your choice)
  • entities and columns
  • database-specific column types
  • entity manager
  • repositories and custom repositories
  • clean object relational model
  • associations (relations)
  • eager and lazy relations
  • uni-directional, bi-directional and self-referenced relations
  • supports multiple inheritance patterns
  • cascades
  • indices
  • transactions
  • migrations and automatic migrations generation
  • connection pooling
  • replication
  • using multiple database connections
  • working with multiple databases types
  • cross-database and cross-schema queries
  • elegant-syntax, flexible and powerful QueryBuilder
  • left and inner joins
  • proper pagination for queries using joins
  • query caching
  • streaming raw results
  • logging
  • listeners and subscribers (hooks)
  • supports closure table pattern
  • schema declaration in models or separate configuration files
  • connection configuration in json / xml / yml / env formats
  • supports MySQL / MariaDB / Postgres / SQLite / Microsoft SQL Server / Oracle / WebSQL
  • supports MongoDB NoSQL database
  • works in NodeJS / Browser / Ionic / Cordova / Electron platforms
  • TypeScript and JavaScript support
  • produced code is performant, flexible, clean and maintainable
  • follows all possible best practices
  • CLI

And more...

See more documentation on a website.

typeorm.github.io's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

typeorm.github.io's Issues

Moving the documentation site to VuePress

Issue type: documentation issue

I'm proposing to migrate the documentation to use VuePress.

It has the following benefits:

  • Fully server-side rendered (better first load time)
  • Pre-compiled Vue components (smaller bundle size and better performance)
  • Compiles markdown during build (documentation fetched from GitHub pages instead of "Raw")
  • Additional features like search

Afterwards, documentation would be able to be directly built and served within this repo. You can host it with either GitHub pages or Netlify (the latter has more feature but needs a brief setup).

Before I file a PR, please answer the following questions:

  • Is this migration desirable?
  • Is the default theme (used on vuepress.org) desirable, or we should modify that to match our current styles?

Any more information around migrations?

Migration documentation is a little light. Diving into the code there are a lot of classes involved, understanding would be greatly improved by more documentation

连接

使用的是mongodb ;
import {ConnectionManager} from 'typeorm'

if (ConnectionManager.get('default')) {

 }

error: typeof ConnectionManager”上不存在属性“get” ,

typeorm cli not running created migrations

Basic informations:

  • typeorm: ^0.3.6
  • os: Windows 11

How to specify the path of my migrations?

ts-node --require tsconfig-paths/register --require ./tsconfig.build.json ./node_modules/typeorm/cli --dataSource ./src/database/typeorm-data-source.ts migration:generate .\src\database\migrations\initial
# Migration E:\DISK\Github\social-media-app\backend\nodejs-nest\src\database\migrations\initial.ts has been generated successfully.
# Done in 3.97s.

ts-node --require tsconfig-paths/register --require ./tsconfig.build.json ./node_modules/typeorm/cli --dataSource ./src/database/typeorm-data-source.ts migration:run
# query: SELECT VERSION() AS `version`
# query: SELECT * FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = 'test' AND `TABLE_NAME` = 'migrations'
# query: SELECT * FROM `test`.`migrations` `migrations` ORDER BY `id` DESC
# No migrations are pending

My DataSource:

import { Comment } from 'src/app/comments/entities/comment.entity';
import { Post } from 'src/app/posts/entities/post.entity';
import { User } from 'src/app/users/entities/user.entity';

import { DataSource } from 'typeorm';
import { SnakeNamingStrategy } from 'typeorm-naming-strategies';

const dataSource = new DataSource({
  type: 'mysql',
  host: 'localhost',
  port: 3306,
  username: 'admin',
  password: '...',
  database: 'test',
  entities: [User, Comment, Post],
  migrations: ['src/app/database/migrations/*.ts'],
  namingStrategy: new SnakeNamingStrategy(),
  // synchronize: true,
});

export default dataSource;

My directory schema, simplified (output by tree)

src/
├── app
│   ├── app.controller.spec.ts
│   ├── app.controller.ts
│   ├── app.module.ts
│   ├── app.service.ts
│   ├── auth/
│   ├── comments/
│   ├── posts/
│   └── users/
├── database
│   ├── database.module.ts
│   ├── migrations
│   │   └── 1650143775406-initial.ts
│   ├── typeorm-data-source.ts
├── main.ts
├── tests
│   └── test-schema.ts
└── types
    └── global.d.ts

Search

I often find myself trying to search through the pages on this site. It would be nice to integrate some kind of search to the page for fast information finding

src folder missing

Hey, sorry if this is a dumb question.
I would like to have the docs available while offline so I have cloned this repository but when executing npm start it cannot find the file

/src/index.ts

Looking at the recently cloned repo, the src folder is missing. I was wondering if this is correct or if I am missing something.
Thanks

[feature request] back to top button

When reading the docs, articles on the right side are always too long, and when finishing reading, we should spend some time to scroll up to view the next article.

Hoping to add a back to top button which would be a great help for the reading experience

Certificate error

Hello, I'm getting cert errors trying to use the website, I don't know if it is some github problem or something you people can fix, but I'm posting anyway just in case...

typeorm

Looks like Common name is set to *.github.com while should be typeorm.io

Here is Brave showing the Cert, sorry for pt-br lang

Este site não pode ser carregado devido a um erro de certificado: https://typeorm.io/#/
net::ERR_CERT_COMMON_NAME_INVALID
Emitido Para
Nome Comum (CN): *.github.com
Número de Série: 09:97:52:34:E8:32:42:49:9B:F5:D1:0B:72:CA:95:1E
Emitido Por
Nome Comum (CN): DigiCert SHA2 High Assurance Server CA
Período de Validade
Começa Em: Sun Mar 19 2017 21:00:00 GMT-0300 (Horário Padrão de Brasília)
Expira Em: Tue Apr 07 2020 09:00:00 GMT-0300 (Horário Padrão de Brasília)
Impressão Digital: sha256: 6f:ec:26:88:81:80:b7:cc:99:00:02:33:0d:24:3a:b1:7b:e8:d4:48:95:a7:8e:52:2e:ac:dc:92:36:d5:3f:cf

Documentation links not working

After the most recent changes from Connection to DataSource the docs for

  • connection-api.md
  • connection-options.md
  • using-ormconfig.md
  • connection.md

are not working.

Switch to static site generator?

I've often tried to use Google to search for terms in the documentation. The issue though is that Google is unable to index the site well with its current setup.

image

Would there be any interest in moving the site over to a solution like GastbyJS to increase SEO? I'd be willing to help with that if interested.

Move DOCS to this repository

Dear TypeORM team,

related to this issue here: typeorm/typeorm#3746 i thought, that it may be better, to move the /docs folder from typeorm/typeorm to this package. What do you think about this?

This way, we could have all the docs (and the corresponding localization stuff) in one single repository?

Obviously, changes to the code (and therefore the docs) are more complicated, because you would need to push into two separate repos..

All the best

Dark mode nav bar is still light

When viewing the documentation in darkmode, the navbar is still light. Tho the content of the navbar seems to be prepared for darkmode.

To reproduce:

  1. set your browser to prefer dark mode,
  2. go to e.g. https://typeorm.io/

What you see:

image

What I'd expect:

image

Browser used: Firefox
Active extension: uBlock origin

Table Inheritance not working

I am using Typeorm with nest js but inheritance is not working
Following image is the result as you can see it has no properties but
image

we have properties in entity table
image
image

documentation: undefined anchors

Issue type:

[ ] question
[ ] bug report
[ ] feature request
[x] documentation issue

Steps to reproduce or a small repository showing the problem:

  1. Open Getting started (https://typeorm.io/#/) in documentation
  2. Hover the anchors and it will be marked as the examples below with undefined
    https://typeorm.io/#undefined/quick-start https://typeorm.io/#/undefined/installation
    <a id="user-content-installation" class="anchor" href="#undefined/installation" aria-hidden="true">#</a>

TS file not compile

I try to run command for compile my ts file to js. used following code.

node src/app

They return error

error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.

I am using node 14.17.4. what is solution

screen shot

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.