Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple SQL statement generation with Repository object #10878

Open
1 of 18 tasks
lizhihui888 opened this issue May 6, 2024 · 0 comments
Open
1 of 18 tasks

Simple SQL statement generation with Repository object #10878

lizhihui888 opened this issue May 6, 2024 · 0 comments

Comments

@lizhihui888
Copy link

Feature Description

I want to generation query conditions SQL with Repository object like this:

where type = 1 and ( name = 'keyword' or code = 'keyword')

The code example is as follows:

this._repository.findOneBy({
    type:1,
    // name:'keyword' || code:'keyword' // how ?
 })

Do not use the Query Builder , only use Repository , what should I do ? thanks

The Solution

I want to generation query conditions SQL with Repository object like this:

where type = 1 and ( name = 'keyword' or code = 'keyword')

The code example is as follows:

this._repository.findOneBy({
    type:1,
    // name:'keyword' || code:'keyword' // how ?
 })

Do not use the Query Builder , only use Repository , what should I do ? thanks

Considered Alternatives

I want to generation query conditions SQL with Repository object like this:

where type = 1 and ( name = 'keyword' or code = 'keyword')

The code example is as follows:

this._repository.findOneBy({
    type:1,
    // name:'keyword' || code:'keyword' // how ?
 })

Do not use the Query Builder , only use Repository , what should I do ? thanks

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant