rexshijaku / sql-to-laravel-builder Goto Github PK
View Code? Open in Web Editor NEWSQL to Laravel Query Builder
License: MIT License
SQL to Laravel Query Builder
License: MIT License
I want to get a Builder object but without get
I want to keep working on it.
possible?
edit: Now I notice that it just generates a string without activation…
Awesome tool
Found a small bug
If you alias the table it gets parsed twice
select * from users as u
join roles as r on r.id = u.role_id
where u.id = 1
DB::table('users as u as u')...
Besides array(), for PHP >= 5.4 it should support also the short syntax [ ].
Example:
Input: select count(*) from table_name where is_active = 0
Output: DB::table('table_name')->count()->where('is_active','=',0);
Output is invalid eloquent, as it first execute count and on that count where clause cannot be executed and gives
Erorr: "Call to a member function whereIn() on int"
I just found this package and found it very interesting. I have tested it with a query, it worked quite well, however it had an error.
SQL Query:
UPDATE ps_feature_value_lang a
JOIN ps_feature_value_lang b ON a.id_feature_value = b.id_feature_value and CHAR_LENGTH(b.value) > 0
SET a.value = b.value
WHERE a.value = ''
Result:
DB::table('ps_feature_value_lang a')
->where('a.value','=','')
->join('ps_feature_value_lang b','a.id_feature_value','=and>','b.id_feature_value')
->update(['a.value'=>DB::raw('b.value')]);
The problem is in '=and>'
CHAR_LENGTH(b.value) > 0
is also ignored.
"union" "union all" gives the same result >union(DB::...
I think must be unionAll(DB::..
INSERT INTO 'table' ('id', 'field') VALUES (22, -5);
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.