Code Monkey home page Code Monkey logo

javascript-example's Introduction

Example how to use TypeORM with JavaScript

  1. clone repository
  2. run npm i
  3. run node src/app1-es5/index.js to run simple example of usage with ES5.
  4. run node src/app2-es5-json-schemas/index.js to run example of usage with ES5 + schemas defined in a JSON.
  5. run node src/app3-es6/index.js to run simple example of usage with ES6.

If you are looking for more advanced JavaScript example with latest ES features and Babel used see here.

javascript-example's People

Contributors

pleerock avatar

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  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

javascript-example's Issues

TypeORM CLI for ES6

When I use the CLI to generate migrations or entities it still generates as typescript.

Example is broken

When I install the latest dependencies for the examples, and then try to run node src/app3-es6/index.js, I get:

name: 'RepositoryNotFoundError',
message: 'No repository for "Post" was found. Looks like this entity is not registered in current "default" connection?' }

Indices in javascript schema

Hello, Is there any way to create indices in the javascript schema?
This feature is documented only with decorators but I tried

module.exports = {
    name: "Category",
    columns: {
        id: {
            primary: true,
            type: "int",
        },
        name: {
            index: true,
            type: "string"
        }
    }
};

Also tried

...
name:{
       index:{
             name: "INAME"
       }
}
...

or with the property indices in the root schema:

...
name: "Category",
indices:[
         {
              name: "INAME",
              columns: ["name"]
         }
]
...

Is this feature supported on javascript schemas or only for typescript using decorators?

Is it possible to use JS decorators using Babel?

Is it possible to use the TypeORM typescript decorators in a Javascript source, using babel? There's a legacy mode for decorators that is supposed to be interoperable with typescript, but I'm not sure it's supported.

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.