Code Monkey home page Code Monkey logo

Comments (6)

glime-ai avatar glime-ai commented on August 24, 2024

To allow MySQL to use AutoDetect and a hardcoded version via overload, you can refer to the commit mentioned in the question. This commit introduces changes that enable the use of an overload for specifying the MySQL version explicitly or allowing the system to auto-detect it.

The commit comment linked in the question provides a discussion around this feature, where the contributors to the Elsa project discuss the implementation details. You can view the changes made in the commit to understand how to implement this in your own project.

Please note that you should always ensure that you are using compatible versions of the packages and that your project's dependencies are correctly configured to avoid any conflicts or issues.

If you need further clarification or assistance, please provide more context or specific questions regarding the implementation.

This comment was generated by Glime.

from elsa-core.

4lexKislitsyn avatar 4lexKislitsyn commented on August 24, 2024

Hi. What do you think about adding method with ServerVersion parameter and use old method with autodetect?

public static DbContextOptionsBuilder UseElsaMySql(this DbContextOptionsBuilder builder, Assembly migrationsAssembly, string connectionString, ElsaDbContextOptions? options = default, Action<MySqlDbContextOptionsBuilder>? configure = default) =>
        UseElsaMySql(builder, migrationsAssembly, connectionString, ServerVersion.AutoDetect(connectionString), options, configure);

public static DbContextOptionsBuilder UseElsaMySql(this DbContextOptionsBuilder builder, Assembly migrationsAssembly, string connectionString, ServerVersion serverVersion, ElsaDbContextOptions? options = default, Action<MySqlDbContextOptionsBuilder>? configure = default) =>
    builder
            .UseElsaDbContextOptions(options)
            .UseMySql(connectionString, serverVersion, db =>
            {
                db
                    .MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly))
                    .MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName())
                    .SchemaBehavior(MySqlSchemaBehavior.Ignore);

                configure?.Invoke(db);
            });

If it's appropriate solution I can open PR today.

from elsa-core.

4lexKislitsyn avatar 4lexKislitsyn commented on August 24, 2024

There is already PR to reverse changes about autodetect (#5621). May be author can add overload that I suggested.

from elsa-core.

sfmskywalker avatar sfmskywalker commented on August 24, 2024

@4lexKislitsyn Makes sense. @raymonddenhaan do you want to update your PR, or shall we ask @4lexKislitsyn to open a new one?

from elsa-core.

raymonddenhaan avatar raymonddenhaan commented on August 24, 2024

@4lexKislitsyn, @sfmskywalker I Updated the PR with the overload

from elsa-core.

sfmskywalker avatar sfmskywalker commented on August 24, 2024

Perfect, thanks @raymonddenhaan & @4lexKislitsyn !

from elsa-core.

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.