Git Product home page Git Product logo

sql-to-laravel-builder's Issues

Bad conversion.

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.

Without get()

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…

Double "as u"

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')...

USING clause on join

doesn't support for "using" clause on join query

SELECT * FROM A JOIN B using (b_id)

select query with count gives faulty result

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.