Open AaronNGray opened 11 months ago
In order to add new fields for typeorm-seeding DataSourceOptions
needs either to be made extensible with new random fields which would remove the name safety or to have the necessary extra fields for seeding added, or perhaps a cleverer mechanism ?
Feature Description
I require a
DataSource.getOptions(): DataSourceOptions
to access :-https://github.com/typeorm/typeorm/blob/master/src/data-source/DataSource.ts#L69
And complement
DataSource.setOptions(options: Partial<DataSourceOptions>): this
https://github.com/typeorm/typeorm/blob/master/src/data-source/DataSource.ts#L206
Something simular to :-
The Solution
this allows access to the DataSource's options as in the following :-
and later in usage
as passed through here :-
https://github.com/typeorm/typeorm/blob/master/src/data-source/DataSource.ts#L140C31-L140C31
Considered Alternatives
Individual options could be passed through but this is limiting and also is just slower and requires knowing what option attributes will be passed through in the future.
Additional Context
No response
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.