MnemosynePostgres.NodeSerializer (mnemosyne_postgres v0.1.1)

Copy Markdown View Source

Round-trip conversion between Mnemosyne node structs and DB-friendly maps.

to_row/3 produces maps suitable for Repo.insert_all. from_row/1 converts DB rows (schema structs or plain maps) back to Mnemosyne node structs.

Summary

Functions

Converts a DB row back into its corresponding Mnemosyne node struct.

Converts a Mnemosyne node struct into a map suitable for Repo.insert_all.

Functions

from_row(row)

@spec from_row(map()) :: struct()

Converts a DB row back into its corresponding Mnemosyne node struct.

to_row(node, tenant_id, repo_id)

@spec to_row(struct(), String.t(), String.t()) :: map()

Converts a Mnemosyne node struct into a map suitable for Repo.insert_all.