Giter Club home page Giter Club logo

Comments (8)

kdcllc avatar kdcllc commented on June 8, 2024 1

@JudahGabriel I have been working on that and also Docker support. https://github.com/kdcllc/Chavah/tree/docker-dotnetsdk2.1. I was going to ask if we can migrate some of the RavenDb data into seeding for the Docker container for testing purposes.

from chavah.

kdcllc avatar kdcllc commented on June 8, 2024 1

@JudahGabriel, I was able to programmaticly to import the data into the Docker container for Chavah.

if (host.IsDevelopment() && !string.IsNullOrEmpty(settings.FileName))
            {
                var importFilePath = Path.Combine(host.ContentRootPath, settings.FileName);

                var operation = new GetDatabaseNamesOperation(0, 1000); // 1000 is safe enough for me.
                var databaseNames = docStore.Maintenance.Server.Send(operation);
                if (databaseNames.Any(_ => _ == docStore.Database)) return services; // database already exists!

                docStore.Maintenance.Server.Send(
                new CreateDatabaseOperation(new DatabaseRecord(settings.DatabaseName)));

                var importOperation = docStore
                                        .Smuggler
                                        .ImportAsync(
                                            new DatabaseSmugglerImportOptions
                                            {
                                                OperateOnTypes = DatabaseItemType.Documents
                                            },
                                            importFilePath,
                                            new CancellationToken()).ConfigureAwait(false).GetAwaiter().GetResult();


                importOperation.WaitForCompletionAsync().Wait();
            }

from chavah.

JudahGabriel avatar JudahGabriel commented on June 8, 2024 1

As of this morning, we're now deployed live with .NET Core 2.1.

from chavah.

JudahGabriel avatar JudahGabriel commented on June 8, 2024

That sounds great. Let me know if you need anything from me to make that happen.

from chavah.

kdcllc avatar kdcllc commented on June 8, 2024

@JudahGabriel I need help with seeding data for RavenDB :)

from chavah.

JudahGabriel avatar JudahGabriel commented on June 8, 2024

Ah. I've attached basic, simple seed data export for Raven: RavenSeedData.zip. It's a zip file that contains a .ravendump file, which you can import.

You can import it via the Studio (Settings -> Import Data) or via code (docStore.Smuggler.ImportAsync(...)).

Is that what you're looking for?

from chavah.

JudahGabriel avatar JudahGabriel commented on June 8, 2024

@kdcllc I saw your email about some uncertainty about this seed data. Did you figure it out?

Your steps here would be:

  1. Unzip RavenSeedData.zip - it contains a single .ravendump file
  2. Import the .ravendump file, either via the Studio (Settings -> Import Data) or code (docStore.Smuggler.ImportAsync(...)).
  3. The database now contains some basic data, several songs, etc.

If you're wanting a .Seed() function that fills up the database with some basic data, you could just have the .Seed method call docStore.Smuggler.ImportAsync(...), passing in the .ravendump file.

from chavah.

JudahGabriel avatar JudahGabriel commented on June 8, 2024

Alternately, if you're just looking for code to create the basic data, we can do that too. Let me know.

from chavah.

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.