Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    goti2
    @goti2
    can i use typeorm on pure javascript ?
    Umed Khudoiberdiev
    @pleerock
    yes you can
    Fanis Prodromou
    @prodromouf_twitter
    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
            .createQueryBuilder("alias")
            .where("
                (:param_one IS NULL OR alias.name = :param_one) AND 
                (:param_two IS NULL OR alias.code = :param_two)"
            )
            .setParameters({
                param_one: filter.param_one,
                param_two: filter.param_two,
                locationMappingName: filter.name,
                locationMappingCode: filter.code,
                locationMappingType: filter.type
            })
            .printSql()
            .getMany();
    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
    @Deviad
    Could anyone suggest me what is the best strategy for handling cases like table does not exist, database does not exist?
    Anthony Gatlin
    @agatlin
    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
    @pleerock
    yes, it is
    André
    @andrecavallari
    Hi... is it possible to use TypeORM in a project without typescript?
    Chris
    @csuich2
    @andrecavallari It is - check out the sample: https://github.com/typeorm/javascript-example
    André
    @andrecavallari
    @csuich2, exactly what I was searching for, thanks buddy!!
    davran-siv
    @davran-siv
    @davran-siv
    Hi there
    could anybody help me? I'm trying to use CreateDateColumn and UpdateDateColumn but it sets null instead of date
    Marian
    @bitflut
    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
    @OwenCalvin
    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
    @krandom
    Hi guys! got an issue with a query, hopefully someone can help out
    const connection = await db()
    await connection
    .getRepository(Visit)
    .createQueryBuilder('vis')
    .select('vis.visitId')
    .addSelect('ord.orderId')
    .innerJoin(Orders, 'ord', 'vis.visitId = ord.visitId')
    .where('vis.locationId = :id', { id })
    .getMany()
    .then(res => (success = res))
    .catch(({ code, message }) => (error = { code, message }))
    why is not orderId showing up in the results?
    Jojie Palahang
    @JojiePalahang
    Hi All I'm new in TypeORM - which is one better GetManager or Repository for CRUD Operation
    Adrian Coroian
    @acoroian
    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
    @deyvedvm_twitter

    Hi,

    Can I use migrations with synchronized database is true?

    pookdeveloper
    @pookdeveloper
    Hello i have this question:
    typeorm/typeorm#5322
    Thanks
    pookdeveloper
    @pookdeveloper
    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
    pookdeveloper
    @pookdeveloper
    I resovel use the alias to set the innerjoin
    Konstantin Kostiuk
    @SET001
    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
    JihenHm
    @JihenHm
    Hello, can someone have the idea on how to change the position of a subtree in the materialized path tree entity?
    Luis Vargas
    @luisvt
    Hello, is there any example how to create a driver for a database?
    aayush300
    @aayush300
    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 )
    @JoinColumn()
    @Column('uuid',{default:null})
    requestedBy: string;
    Konstantin Kostiuk
    @SET001
    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
    @luisvt
    Is there any work to split drivers in separate library?
    And using lerna or nrwl for monorepo?
    dev-ster
    @dev-ster
    How can we check a entity property for its decorator? Can we use Reflect.getMetadata() to check properties that have manytomany decorator?
    Luis Vargas
    @luisvt
    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
    @luisvt
    @here please somebody check this PR:
    typeorm/typeorm#6269
    dev-ster
    @dev-ster
    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
    @dustinrech_gitlab
    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
    @isaacwashere
    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!
    sushilkadu-yara
    @sushilkadu-yara
    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.