export function relationships(table, cb) {
    const relationships = cb({ many, one });
    return {
        name: table.schema.name,
        relationships,
    };
}
function many(...args) {
    return args.map(arg => ({
        sourceField: arg.sourceField,
        destField: arg.destField,
        destSchema: arg.destSchema.schema.name,
        cardinality: 'many',
    }));
}
function one(...args) {
    return args.map(arg => ({
        sourceField: arg.sourceField,
        destField: arg.destField,
        destSchema: arg.destSchema.schema.name,
        cardinality: 'one',
    }));
}
//# sourceMappingURL=relationship-builder.js.map