Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

typeorm-how-to-write-to-different-databases

// src/index.ts
    await createConnection({
      name: 'connection1',
      host: 'SERVER1',
      username: 'bob',
      password: 'xxx',
      type: 'mssql',
      database: 'db1',
      synchronize: true,
      entities: ['src/entity/**/*.ts'],
      migrations: ['src/migration/**/*.ts'],
      subscribers: ['src/subscriber/**/*.ts'],
      cli: {
        entitiesDir: 'src/entity',
        migrationsDir: 'src/migration',
        subscribersDir: 'src/subscriber',
      },
    })

    await createConnection({
      name: 'connection2',
      host: 'SERVER2',
      username: 'mike',
      password: 'xxx',
      type: 'mssql',
      database: 'db2',
      synchronize: true,
      entities: ['src/entity/**/*.ts'],
      migrations: ['src/migration/**/*.ts'],
      subscribers: ['src/subscriber/**/*.ts'],
      cli: {
        entitiesDir: 'src/entity',
        migrationsDir: 'src/migration',
        subscribersDir: 'src/subscriber',
      },
    })
Comment

PREVIOUS NEXT
Code Example
Javascript :: reduce dot notations to javascript array 
Javascript :: fetch 500 internal server error 
Javascript :: JavaScript delete atray item 
Javascript :: Any array in JSON object is not empty 
Javascript :: How to access a preexisting collection with Mongoose 
Javascript :: style dropdown react native picker 
Javascript :: ant design rtl 
Javascript :: react native communications 
Javascript :: No enum constant datepicker react native 
Javascript :: json query rails c 
Javascript :: assign single value to multiple variables in React js Or javacript 
Javascript :: Importing Ky Module In JavaScript 
Javascript :: create a group or pool in phaser 
Javascript :: switching light bulbs problem javascript 
Javascript :: string to date with ist javascript 
Javascript :: wait for element to be loaded 
Javascript :: photoshop Change image size JavaScript 
Javascript :: Create Built-in AbortController Object 
Javascript :: continuously update last updated time react js 
Javascript :: Getting The Search Params With A For Of Loop 
Javascript :: Looping through array, fetching tweets and returning new reversed array javascript react 
Javascript :: react use last state 
Javascript :: destructuring array es6 
Javascript :: recursive function and json object 
Javascript :: auto load window on change viewport react 
Javascript :: Solution-2--solution options for reverse bits algorithm js 
Javascript :: types of variables in javascript 
Javascript :: convert 12 hour to 24 hour javascript 
Javascript :: moment max 
Javascript :: button prevent default 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =