@Jake though;
What is the expected output?
 { id: { foo: 1, bar:3 }, parent_id : { foo: 4, bar: 1} }

or
 { id: [1,3], parent_id : [4,1] }
or
 { id: [ 0:1, 1:3, foo: 1, bar:3 ], parent_id : [ 0:4, 1::1, foo: 4, bar:
1] }

or
 { foo : { id : 1, parent_id:3 }, bar : { id: 1, parent_id:3 } } ?


On Mon, Jan 15, 2018 at 1:59 AM, J Decker <[email protected]> wrote:

> Maybe this patch (the same, but against original source instead of
> amalgamation) against current fossil head
>
>
Hmm updated tests too; but bork capi3.test; I don't know how to sperate .22
and .32 to differentiate the expected results ....


> https://drive.google.com/open?id=1c24qvtvS57ASJF5RfZxLJSsgI2FhOVk1
>
>
> On Sun, Jan 14, 2018 at 11:17 PM, Jake Chen <[email protected]> wrote:
>
>> Hi Peter,
>>
>> Currently the query result returned by node-sqlite3 has the rows
>> formatted into objects all ready. Given SQL `SELECT foo.*, bar.* FROM foo
>> JOIN bar`, the columns of foo and bar collide with each other. I've already
>> sent a PR https://github.com/mapbox/node-sqlite3/pull/932 <
>> https://github.com/mapbox/node-sqlite3/pull/932> to node-sqlite3 to
>> allow a different result structure that keeps the rows untouched and
>> returns fields along with rows.
>>
>> However, when the SQL contains table aliases, such as `SELECT foo.*,
>> bar.* FROM egg AS foo JOIN egg AS bar ON foo.id <http://foo.id/> =
>> bar.parent_id`, there's no way to return the fields correctly since
>> `sqlite_column_table_name()` returns the actual table name rather than the
>> alias. The link I attached in previous post is a discussion that took place
>> 4 years ago. OP suggests a new function called
>> `sqlite_column_table_alias_name()` to return the table alias instead of
>> actual name. A patch is attached to implement this function. The major
>> change is in `columnTypeImpl` of `src/select.c`:
>>
>> @@ -105364,6 +105386,7 @@
>>           if( j<pTabList->nSrc ){
>>             pTab = pTabList->a[j].pTab;
>>             pS = pTabList->a[j].pSelect;
>> +          zTableAlias =
>> pTabList->a[j].zAlias?pTabList->a[j].zAlias:pTabList->a[j].zName;
>>           }else{
>>             pNC = pNC->pNext;
>>           }
>>
>> Source: http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlit
>> e-users/2014-November/056388.html <http://mailinglists.sqlite.or
>> g/cgi-bin/mailman/private/sqlite-users/2014-November/056388.html>
>>
>> Jake
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to