Effect CommunityEC
Effect Community3y ago
14 replies
tatchi

Dynamically Setting Migration Path in Sql Layer

I have this piece of code to construct my Sql layer

export const SqlLive = Layer.provideMerge(
    Migrator.makeLayer({
        loader: Migrator.fromDisk(Path.resolve(__dirname, '../migrations')),
    }),
    Sql.makeLayer(...),
);


And I would like to be able to dynamically set the migration path based on an env variable, i.e something like Config.string("NODE_ENV"). Is it possible ?
Was this page helpful?