You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
892 B
24 lines
892 B
import {ErrorWithContext} from "../../util";
|
|
import {Container} from "../../di";
|
|
import {ResultIterable} from "./result/ResultIterable";
|
|
import {QueryRow} from "../types";
|
|
import {AbstractBuilder} from "./AbstractBuilder";
|
|
import {AbstractResultIterable} from "./result/AbstractResultIterable";
|
|
|
|
/**
|
|
* Implementation of the abstract builder class that returns simple QueryRow objects.
|
|
*/
|
|
export class Builder extends AbstractBuilder<QueryRow> {
|
|
public getNewInstance(): AbstractBuilder<QueryRow> {
|
|
return Container.getContainer().make<Builder>(Builder);
|
|
}
|
|
|
|
public getResultIterable(): AbstractResultIterable<QueryRow> {
|
|
if ( !this._connection ) {
|
|
throw new ErrorWithContext(`No connection specified to fetch iterator for query.`)
|
|
}
|
|
|
|
return Container.getContainer().make<ResultIterable>(ResultIterable, this, this._connection)
|
|
}
|
|
}
|