Skip to content

Commit

Permalink
fix: make types configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Apr 13, 2017
1 parent a539c33 commit 6af8087
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export type DatabaseSingleConnectionType = {
export type DatabasePoolConnectionType = DatabaseConnectionType;

export type DatabaseConnectionType = {
+any: QueryAnyType,
+any: QueryAnyType<*>,
+insert: QueryInsertType,
+many: QueryManyType,
+one: QueryOneType,
+query: QueryType
+many: QueryManyType<*>,
+one: QueryOneType<*>,
+query: QueryType<*>
};

export type QueryResultRowType = {
Expand Down Expand Up @@ -64,8 +64,8 @@ export type InternalQueryOneType = (connection: InternalDatabaseConnectionType,
export type InternalQueryManyType = (connection: InternalDatabaseConnectionType, sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<QueryResultRowType>>;
export type InternalQueryAnyType = (connection: InternalDatabaseConnectionType, sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<QueryResultRowType>>;

export type QueryType = (sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<QueryResultRowType>>;
export type QueryType<T: QueryResultRowType> = (sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<T>>;
export type QueryInsertType = (sql: string, values?: DatabaseQueryValuesType) => Promise<InsertResultType>;
export type QueryOneType = (sql: string, values?: DatabaseQueryValuesType) => Promise<QueryResultRowType>;
export type QueryManyType = (sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<QueryResultRowType>>;
export type QueryAnyType = (sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<QueryResultRowType>>;
export type QueryOneType<T: QueryResultRowType> = (sql: string, values?: DatabaseQueryValuesType) => Promise<T>;
export type QueryManyType<T: QueryResultRowType> = (sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<T>>;
export type QueryAnyType<T: QueryResultRowType> = (sql: string, values?: DatabaseQueryValuesType) => Promise<$ReadOnlyArray<T>>;

0 comments on commit 6af8087

Please sign in to comment.