db_walk_query

module
v0.0.0-...-47e1cbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2024 License: Apache-2.0

README

An example of loading graphs of objects from a database using a field walker to determine the graph of objects to load using joins.

The code in the loader package is written to be somewhat generic, but is largely untested, and makes no attempt to support multiple databases.

A more full-fledged implementation of the loader would support multiple arguments in the directives to allow mapping user supplied arguments, and controlling how the prefetches happen (i.e. subselects, sequential queries loaded with id's from the parent level, etc.).

Judicious use of reflection could simplify creating adapters to DBModel to avoid a good deal of boilerplate code.

Implementing all of the above would veer dangerously close to code that should be in an ORM. A more realistic approach may be to use similar code to integrate with an ORM and allow the ORM to build and execute the SQL queries.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL