Skip to content

Instantly share code, notes, and snippets.

@chrismeller
Created November 1, 2011 16:36
Show Gist options
  • Save chrismeller/1331052 to your computer and use it in GitHub Desktop.
Save chrismeller/1331052 to your computer and use it in GitHub Desktop.
<?php
class Model_Browser extends Model {
public function list_schemas ( $like = null ) {
$query = \DB::select( array( 'table_schem', 'schema' ) )->from( 'sysibm.sqltables' );
if ( $like != null ) {
$query->where( 'table_schem', 'like', $like );
}
$query->order_by('schema');
// make it distinct
$query->distinct();
// we want an object back
$query->as_object();
// execute!
$result = $query->execute();
return $result;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment