Questions tagged [sqlbuilder]

SqlBuilder is designed to make dynamic SQL tasks easier.

DbExtensions: https://maxtoroq.github.io/DbExtensions/docs/SqlBuilder.html

Laravel 4: https://www.npmjs.com/package/sqlbuilder

Open HMS: https://openhms.sourceforge.io/sqlbuilder/

44 questions
117
votes
5 answers

Is there any good dynamic SQL builder library in Java?

Anyone knows some good SQL builder library for Java like Squiggle (not maintained anymore it seems). Preferably, a project in active development. Preferably with syntax like Zend_Db_Select, something that will allow to make a query like String…
Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
26
votes
3 answers

Java: JOOQ persistence framework performance and feed back

I've stumbled over a nice SQL builder framework, called JOOQ. BTW, in Russian JOOQ sounds like noun meaning "bug" (as an insect), "beetle" ;) If you have any feedback about JOOQ, it's performance and such, please share. Links to blogs about JOOQ…
Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
13
votes
5 answers

How to use SqlBuilder

This SqlBuilder: var builder = new SqlBuilder(); var sql = builder.AddTemplate( /*... Intensely dumb question but, how do I use this? I know it's in Dapper.Contrib, but that using statement isn't enough. What references or other using statements…
idlackage
  • 2,715
  • 8
  • 31
  • 52
11
votes
3 answers

Good way to generate SQL strings in java?

I'm not looking for a persistence layer like Hibernate, I just want to generate SQL-strings and they should be compatible with PreparedStatement. I've tried libraries such as Squiggle, but it only supports SELECT, I would also like to generate…
pgsandstrom
  • 14,361
  • 13
  • 70
  • 104
11
votes
3 answers

Dapper SqlBuilder OrWhere using AND instead of OR

I was trying to use the Where and OrWhere methods of SqlBuilder for Dapper, but it is not acting like how I would expect. The edited portion of this question is basically what I ran into. Since it didn't receive a response, I'll ask it here. var…
Fama
  • 346
  • 2
  • 11
7
votes
5 answers

Generic SQL builder .NET

I'm looking for a way to write an SQL statement in C# targeting different providers. A typical example of SQL statements differentiating is the LIMIT in PostgreSQL vs. TOP in MSSQL. Is the only way to solve SQL-syntax like the two above to write…
Patrick
  • 17,669
  • 6
  • 70
  • 85
5
votes
4 answers

How to build SELECT query with sqlbuilder?

I am using Java and SQLBuilder from http://openhms.sourceforge.net/sqlbuilder/ and am trying to build SQL SELECT query dynamicly: SelectQuery sql = new…
Dmitry K
  • 1,142
  • 2
  • 16
  • 27
5
votes
1 answer

How to use Dapper's SqlBuilder?

I can't find any documentation or examples I can follow to use the SqlBuilder class. I need to generate sql queries dynamically and I found this class. Would this be the best option?
user3900456
  • 2,003
  • 3
  • 25
  • 33
4
votes
4 answers

Comparing sql with c# list in query?

I have a problem with comparing a value in my sql database with a list of object in my code. The object does not exist in DB Example of an object in the list: { public long CompareId public bool HasAccess } I'm using SQLBuilder in c# And…
LittleMygler
  • 632
  • 10
  • 24
4
votes
2 answers

SQLBuilder ForeignKeyConstraint - set cascade

Using the API SQL Builder com.healthmarketscience.sqlbuilder. DbForeignKeyConstraint constraint = dbTable.foreignKey("fk_" + tableName + "_" + foreignTableName, columnList.toArray(new String[0]), foreignTableName, …
theAnonymous
  • 1,701
  • 2
  • 28
  • 62
4
votes
2 answers

How do I build a dynamic sql query with Dapper.SqlBuilder and OrWhere

I am attempting to build a dynamic Sql query for multiple search terms. I understand in general how to use the builder, but am not sure what to do in the loop since I actually need the @term to be different each time (I think). Not just in the…
phil
  • 618
  • 2
  • 5
  • 17
4
votes
10 answers

SQL Builder for PHP, with JOIN support?

Are any of you aware of a library that helps you build/manipulate SQL queries, that supports JOIN's? It would give a lot of flexibility i'd think if you have something where you could return an object, that has some query set, and still be able to…
David
  • 1,031
  • 2
  • 10
  • 11
3
votes
1 answer

Dapper, SqlBuilder extension and Order By descending

I am trying to build a simple query that retrieves data in descending order using Dapper. The database is MySql if that's important. This is the code I used: var builder = new SqlBuilder(); var sql = @$"SELECT * FROM table t /**orderby**/ LIMIT…
Ivan ho ho ho
  • 57
  • 3
  • 9
3
votes
1 answer

Build Dapper SQL Builder query param using Reflection

I'm working on the project that use Dapper as our DAL layer and because of we're still using inline queries. To construct our query, we're using dapper sqlBuilder template. Below is one of our method code: SqlBuilder builder = new SqlBuilder(); …
Martin Valentino
  • 1,002
  • 2
  • 11
  • 26
3
votes
1 answer

Creating a PreparedStatement from a jooq Query

Currently exploring the possibilities of JOOQ, I want to start carefully and only use JOOQ as an SQL builder. I defined my database schema as classes derived from CustomTable to get type safety. This leads to code like Param pId = ... Query…
Harald
  • 4,575
  • 5
  • 33
  • 72
1
2 3