Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    can i use typeorm on pure javascript ?
    Umed Khudoiberdiev
    yes you can
    Fanis Prodromou
    hi all!
    I have a simple query in typeorm for postgresql db and not sure what I am doing wrong but I am getting the error message
    "message": "could not determine data type of parameter $1", "name": "QueryFailedError", "length": 111, "severity": "ERROR", "code": "42P18", "file": "postgres.c", "line": "1344", "routine": "exec_parse_message",
    the query is
    await this.myRepo
                (:param_one IS NULL OR alias.name = :param_one) AND 
                (:param_two IS NULL OR alias.code = :param_two)"
                param_one: filter.param_one,
                param_two: filter.param_two,
                locationMappingName: filter.name,
                locationMappingCode: filter.code,
                locationMappingType: filter.type
    aparently the error come from the line :param_one IS NULL OR alias.name = :param_one
    does anyone knows how can I check if a given variable is null?
    Davide Pugliese
    Could anyone suggest me what is the best strategy for handling cases like table does not exist, database does not exist?
    Anthony Gatlin
    Hi there :)
    Is it possible with typeorm to connect to multiple databases of different types simultaneously such as a Microsoft SQL Server database and a SQLite database.
    Umed Khudoiberdiev
    yes, it is
    Hi... is it possible to use TypeORM in a project without typescript?
    @andrecavallari It is - check out the sample: https://github.com/typeorm/javascript-example
    @csuich2, exactly what I was searching for, thanks buddy!!
    Hi there
    could anybody help me? I'm trying to use CreateDateColumn and UpdateDateColumn but it sets null instead of date
    Hi! I'm currently setting up an api using TypeORM with mongoDB. I'm struggling with conversions for mongoDB's ObjectID. Sometimes it is an object with hex values, sometimes a string and other times an ObjectID instance. How do you properly handle conversion in your entities? Do you transform ids to strings generally?
    Owen Calvin
    Screenshot 2018-10-20 at 14.07.48.png
    Screenshot 2018-10-20 at 14.08.11.png
    I've a duplicated Id error when I save...
    Logan Valentine
    Hi guys! got an issue with a query, hopefully someone can help out
    const connection = await db()
    await connection
    .innerJoin(Orders, 'ord', 'vis.visitId = ord.visitId')
    .where('vis.locationId = :id', { id })
    .then(res => (success = res))
    .catch(({ code, message }) => (error = { code, message }))
    why is not orderId showing up in the results?
    Jojie Palahang
    Hi All I'm new in TypeORM - which is one better GetManager or Repository for CRUD Operation
    Adrian Coroian
    hi guys using typeorm with MSSQL . works regularly. Trying to use a connection string instead of host, port, etc.
    With connection string it does not work. The mssql string is Data Source=[server];Initial Catalog=[catalog];[some more crap here]
    does typeorm support this?
    when i do it it seems to drop the D from Data Source i get an error that ata Source ERRNOTFOUND
    Deyve Vieira


    Can I use migrations with synchronized database is true?

    Hello i have this question:
    Hello how i can do that?
    var manager = getManager().getRepository("A").createQueryBuilder("A")
    .innerJoin("A.B1", 'B1')
    .innerJoin("A.B1.C1", 'C');
    the entitys are corrrect
    its a join includes other join
    I resovel use the alias to set the innerjoin
    Konstantin Kostiuk
    Hi. I'm having a problem when two microservices use same postgres database, write i'ts migrations and then I can't revert some single service migration because typeorm will go to dabatase and see there are migration from another servise, and will not find them in folder of first service and will fail then
    Hello, can someone have the idea on how to change the position of a subtree in the materialized path tree entity?
    Luis Vargas
    Hello, is there any example how to create a driver for a database?
    Hi all, i am facing a issue i have created a joined column in a entity (having many to one relation), in postgres this entity generates a seperate joined column , when i am updating this column , normal requestedBy column is getting updated but the joined column is not getting updated..can anyone resolve this issue... Thanks in advance
    @ManyToOne(type => UserEntity, UserEntity=>UserEntity.userId )
    requestedBy: string;
    Konstantin Kostiuk
    I created a model, extending it from BaseEntity and now doing something like this
    const password = new Password(); Object.assign(password, passInfo); const created = await password.save();
    • are there easier ways to assign models values?
    • doing so, does not autofill created_at field with current timestamp. how can I solve this?
    Luis Vargas
    Is there any work to split drivers in separate library?
    And using lerna or nrwl for monorepo?
    How can we check a entity property for its decorator? Can we use Reflect.getMetadata() to check properties that have manytomany decorator?
    Luis Vargas
    Hello, when trying to run test custom cache provider I got next error:
    QueryFailedError: Wrong API use : tried to bind a value of an unknown type (undefined).
        at new QueryFailedError (src/error/QueryFailedError.ts:9:9)
        at SqljsQueryRunner.<anonymous> (src/driver/sqljs/SqljsQueryRunner.ts:81:22)
        at step (node_modules/.pnpm/tslib@1.13.0/node_modules/tslib/tslib.js:141:27)
        at Object.next (node_modules/.pnpm/tslib@1.13.0/node_modules/tslib/tslib.js:122:57)
        at /home/luis/projects/typeorm/typeorm/node_modules/.pnpm/tslib@1.13.0/node_modules/tslib/tslib.js:115:75
        at new Promise (<anonymous>)
        at Object.__awaiter (node_modules/.pnpm/tslib@1.13.0/node_modules/tslib/tslib.js:111:16)
        at /home/luis/projects/typeorm/typeorm/src/driver/sqljs/SqljsQueryRunner.ts:48:50
        at new Promise (<anonymous>)
        at SqljsQueryRunner.query (src/driver/sqljs/SqljsQueryRunner.ts:48:16)
        at UpdateQueryBuilder.<anonymous> (src/query-builder/UpdateQueryBuilder.ts:98:46)
    what could it be wrong?
    looks like the error is caused because of sql.js
    Luis Vargas
    @here please somebody check this PR:
    How can we specify an array of enums in a typeorm entity?
    @Column({ type: 'enum', enum: Tooth })
        affectedTeeth: Tooth[] ;
    This creates a type error
    Dustin Rech
    I'm getting 'QueryFailedError: Error: Validation failed for parameter '5'. Invalid date' when submitting null values to date columns using the MSSQL driver. The entity column is defined as '@Column('datetime', { nullable: true })' and the table also reflects 'Allow Nulls' for the column. I'm not sure what or where the validation is coming from (typeorm/tedious/mssql driver) but I can insert directly into the table with nulls in the column using a SQL tool. I think I'm missing something simple but not sure what else to look at. Can anyone provide insight?
    Isaac Curtiss
    Hi, does anyone know if it is possible to run a single specific migration ( instead of running all of them at once)? I’m assuming this functionality would exist in the TypeORM CLI but all I’ve found is a reference to running all migrations. Any help, would be appreciated!
    I'm trying to integrate Typeorm on react-native (js and not typescript), I'm getting this issue DriverPackageNotInstalledError: React-Native package has not been found installed. Try to install it: npm install react-native-sqlite-storage --save. Even though this dependency is installed, I'm still getting this error.