Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add insert selects #3

Open
tenorviol opened this Issue · 0 comments

1 participant

@tenorviol
Owner

Should be able to dump other grubby queries into the create statement. This example copies all rows from table2 with foo='bar' into table1.

$table1->create($table2->filter('foo'=>'bar'));

This maps to SQL:

INSERT INTO table1 ({common rows})
SELECT {common rows}
FROM table2
WHERE foo='bar'

EXCEPTION: Wherever possible this should map to an insert select, but sometimes another tactic must be employed. For example, table2 may not be on the same database server as table1. In this case, we will automatically do a transfer through PHP: pull a punch of records and insert them until all records have been pulled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.