Basically, just to break it down: You need to provide 3 procs for mapping as defined on that webpage: - dbType(T: typedesc[YourType]) -> string maps your Nim type to a database type (e.g. func dbType(T: typedesc[string]): string = "TEXT" for SQLite) - dbValue(YourType) -> DbValue converts an instance of YourType to a DbValue instance. - to(DbValue, T: typedesc[YourType]) -> T converts a DbValue instance to an instance of YourType.