x-ream / sqli Goto Github PK
View Code? Open in Web Editor NEWorm sql query builder, API: QB, QB.X, QrB
Home Page: http://sqli.xream.io
License: Apache License 2.0
orm sql query builder, API: QB, QB.X, QrB
Home Page: http://sqli.xream.io
License: Apache License 2.0
Maybe there will be no a database dialect extends ClickhouseDialect
Developer knows the SQL Injection while coding native SQL.
The native api: execute(sql)
1 issue description
2. fix bug, enhance....
3. git commit -m "issue name (#issue number)"
SQLI only support delete by PK, and safe update by PK, consider it, add LIMIT
CriteriaBuilder.ResultMapBuilder builder = CriteriaBuilder.resultMapBuilder();
builder.resultKey("id");
builder.resultKey("name");
builder.eq("id", 1);
Criteria criteria = builder.build();// OK
Criteria.ResultMapCriteria criteria = builder.build();// unworkable
if add code: builder.sourceBuilder().source("foo"); //unworkable
Anyway, CriteriaBuilder.ResultMapBuilder should get Criteria.ResultMapCriteria
ResultMapBuilder designed for JOIN, and should support one table.
use CriteriaSyntaxException
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
查询数据库单表指定的某几个字段时,希望能把响应的结果List<Map<String, Object>>封装成List
SqlExportor.exportor().source(Cat.class).build("testSub",resultMapCriteria).export("CriterialToSqlTester");
DaoHelper can not describe the logical, it is SqlBuilder
if (e instance of RuntimeException){
throw (RuntimeException) e;
}
@X.Tag
@X.Tag{ boolean isKey() default false; }
It is not override method, the method only generate part of sql, "where ...."
contains(".")
throw ParsingException
throw new SqliRumtimeException
....
Not test? @chengyunyong
ParserUtil.getClzName(alia, aliaMap)
Customizer should be call at SqliListener
Add API: resultMapBuilder.sourceBuilder().with(Sub).alia(name);
like resultMapBuilder.sourceBuilder().sub(Sub).alia(name);
特别提醒
Retry和Fallback的正确姿势: add retry at controller, or remote client
不能在代码的service和repository层加retry, 和fallback
在不适合或没必要用分布式框架(seata, x-ream/reliable)的情况下, 做fallback的时候, 需要小心
X.Tag(isKey = true) should be X.TagTarget
FooRepository extends BaseRepository, ResultMapRepository,
invoke find(resultMapCriteria), debug no log
last(long last):
if last != 0
where orderBy > last ... LIMIT ... (ASC)
where orderBy < last ... LIMIT ... (DESC)
else
OFFSET ...
EnumSerializer
EnumDeserializer
select count(1) from table where name = ? limit 1
"error": "StatementCallback; bad SQL grammar [SELECT * FROM Equipment WHERE ( barCode IN ( 'lb1649400074854' ) OR RFID IN ( ) OR nfc IN ( ) OR recorderCode IN ( ) )]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR nfc IN ( ) OR recorderCode IN ( ) )' at line 1",
Sometimes forgot
if (dialect.getKey().contains("mysql") && SqliStringUtil.isNotNull(createSql)) {
nativeSupport.execute(clz, createSql);
}
@X.Tag { boolean isKey() default false; }
throw e
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.