mardi 22 décembre 2015

What is the benefit of Laravel's query builder?

I am learing laravel 5, but I am at query builder phase, and after looking on first code snippets I think it is really useless when somebody have basic SQL knowledge

Example:

$users = DB::table('users')
->select(DB::raw('count(*) as user_count, status'))
->where('status', '<>', 1)
->groupBy('status')
->get();

What is the purpose of learning query builder syntax if the programmer actually have at least basic knowledge about SQL language? Moreover moving advanced query from clean SQL language to query builder functions looks like nightmare...



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire