Skip to content

QueryTimeout is always overwritten in the QueryHelper.CreateQueryFactory #345

@Mostafa-Elmoghazi

Description

@Mostafa-Elmoghazi

Hello,

I've started using the SqlKata library recently in a data analytical project that depends heavily on dynamic queries. I'me working on very complicated queries that sometimes take a bit long time to execute. I'm facing an issue while setting the timeout of the query on SqlKata. I've set the timeout on the QueryFactory instance I've created to 5000000 but the query still times out. When I looked at the source code of execution library, I found this:

Given the following code:
var db = new QueryFactory(connection, compiler);
db.QueryTimeout = 5000000;
var result = db.Query("ApplicationUsers").Get<dynamic>();

Here Get function calls QueryHelper.CreateQueryFactory which recreate a new QueryFactory instance with QueryTimeout property set to its default 30.

How can I get my own QueryFactory instance execute the query with my set QueryTimeout value and without getting new instance of QueryFactory created?

Note: I'm using the latest stable version v1.1.7

@ahmad-moussawi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions