Coder Social home page Coder Social logo

Comments (3)

kluzzebass avatar kluzzebass commented on September 3, 2024

I've just been prefixing the seed files with a number (like 10_my_seed_file.ts), which seems to work fine.

from deno-nessie.

ebebbington avatar ebebbington commented on September 3, 2024

@halvardssm why not take the laravel approach, and the user create/define a base seeder class that runs the other seeders? for example from a php project:

<?php

// database/seeders/DatabaseSeeder.php

namespace Database\Seeds;

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        // Run in this order
        $this->call(A::class);
        $this->call(B::class);

        $this->call(C::class);
        $this->call(D::class);
    }
}

from deno-nessie.

halvardssm avatar halvardssm commented on September 3, 2024

I am inclined to the approach from @ebebbington but the question is then the implementation. I would say that the default behaviour should be the seed name in ascending order, and then an optional property in the config object (or a CLI flag) can give a path to a seed runner file. The only thing on my end which I am not too sure about is whether this should be a class or a function, but seeing as Nessie is fully class-based, we might as well continue on this path. I won't have time to implement this in the forseable future, so anyone are free to pick this up and send a PR :)

from deno-nessie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.