moigagoo / norm

A Nim ORM for SQLite and Postgres
https://norm.nim.town
MIT License
378 stars 34 forks source link

Feature/142 multi many to many query procs #158

Closed PhilippMDoerner closed 1 year ago

PhilippMDoerner commented 2 years ago

There were 2 issues in my new feature: 1) There were still some variable assignments instead of using static discard 2) If you were using selectOneToMany and the "many"-model had the FK field as optional or just annotated via fk pragma, the proc couldn't deal with it. Similarly, selectManyToMany could not deal with the joinModel having an Option[Many-Model] type. (It can't deal with int64 or Option[int64] types by design since the goal is to extract the actual model from the joinModel field).

This PR should fix that. Changelog adjustments are already included. Tests all pass

PhilippMDoerner commented 1 year ago

@moigagoo Requesting Feedback ^^