sphinxql
Version:
SphinxQL query builder for Node.JS. Supports Sphinx search(2.x and 3.x) and Manticore search
21 lines (17 loc) • 503 B
text/typescript
import ClientInterface from '../ClientInterface';
export default abstract class BaseStatement {
protected connection: ClientInterface;
constructor(connection: ClientInterface) {
this.connection = connection;
}
/**
* Generates the string statement and returns it.
*/
abstract generate(): string;
/**
* Run the query and returns a promise that can be accepted or rejected.
*/
public execute(): Promise<any> {
return this.connection.execute(this.generate(), []);
}
}