Experimental SQLite support
This commit is contained in:
@@ -2,9 +2,10 @@ import {Model} from './Model'
|
||||
import {AbstractResultIterable} from '../builder/result/AbstractResultIterable'
|
||||
import {Connection} from '../connection/Connection'
|
||||
import {ModelBuilder} from './ModelBuilder'
|
||||
import {Container, Instantiable} from '../../di'
|
||||
import {Instantiable} from '../../di'
|
||||
import {QueryRow} from '../types'
|
||||
import {collect, Collection} from '../../util'
|
||||
import {getFieldsMeta} from './Field'
|
||||
|
||||
/**
|
||||
* Implementation of the result iterable that returns query results as instances of the defined model.
|
||||
@@ -60,8 +61,11 @@ export class ModelResultIterable<T extends Model<T>> extends AbstractResultItera
|
||||
* @protected
|
||||
*/
|
||||
protected async inflateRow(row: QueryRow): Promise<T> {
|
||||
return Container.getContainer().make<T>(this.ModelClass)
|
||||
.assumeFromSource(row)
|
||||
const model = this.make<T>(this.ModelClass)
|
||||
const fields = getFieldsMeta(model)
|
||||
return model.assumeFromSource(
|
||||
this.connection.normalizeRow(row, fields),
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user