Comments (16)
@lecaillon Is this something you would accept a PR on? If so, I could prioritize implementing it against the current version
from evolve.
Let me release the Evolve 2.0 version.
It's a major rework of Evolve to help simplify the overall design.
When it's finish it should let me a lot more time to add new features like this one. Promess ;)
from evolve.
@GeirGrusom @ld0614 @jouana @modernist @CaueArua
Actively working on it for the next release: Evolve 2.1.0
Thanks to @mhelleborg for its PR that helps me a lot.
I have to implement it in Evolve, but also in Evolve.MSBuild and the CLI.
Shoudn't be too long though.
Usage
try
{
var cnx = new SqliteConnection(Configuration.GetConnectionString("MyDatabase"));
var evolve = new Evolve.Evolve(cnx, msg => _logger.LogInformation(msg))
{
Locations = new[] { "ConsoleApp1.db.migrations" },
EmbeddedResourceContext = Assembly.GetExecutingAssembly()
};
evolve.Migrate();
}
catch (Exception ex)
{
_logger.LogCritical("Database migration failed.", ex);
throw;
}
Feel free to give me your feedback
from evolve.
@lecaillon I think I would prefer having a cleaner API, and maybe drop the functionality from the CLI. I think most of the value proposition for me is using Evolve from code, but other people might have other use cases :)
from evolve.
Hi, I don't have feedback where have files in a script folder is a problem either on Windows or Linux. More over hide the scripts in the assembly goes against the simplicity and the transparency goal of Evolve IMO.
from evolve.
My cases:
-
Embedded resources won't get confused by application shadowing or other such monkey business (we have an application that has made it exceptionally awkward to find file relative to the application).
-
Migrations scripts should not be altered by hand on-site, and embedded resources makes sure that doesn't happen without developer intervention.
Simply put I think it makes it easier to deploy. Also flyway supports loading migration scripts from the jar.
from evolve.
I think this is a good option and would have avoided my issues in #76
from evolve.
Hi everyboby,
It should be cool to have this feature.
We have a WPF application with SQLite, this feature should help us for many way.
Regards.
from evolve.
This feature is exencial when you build an application that will run on client. If you expose the spl you have a major security breach.
Please implement this feature.
from evolve.
+1. I totally agree this is a useful feature. @lecaillon @mhelleborg if any help is needed to move this forward towards a release let me know, it's been almost a year since the PR was opened.
from evolve.
@lecaillon You could improve upon my original interface with a list of assembly / locations, instead of the single EmbeddedResourceContext. I think that would be better than overloading the file locations, and would support potentially loading scripts from multiple assemblies. It also makes the interface contract less ambigous :)
from evolve.
@mhelleborg You think in this case something like ResourceFilters
is more suitable than Locations ?
So you would have 2 new properties:
- EmbeddedResourceLocations
- EmbeddedResourceFilters
from evolve.
@lecaillon I was more thinking sending in a list of assemblies with a set of locations each. More or less a tuple of assembly and list of locations.
Alternatively, just let the user provide a lambda which returns an IEnumerable of migrations. Then they can be loaded from anywhere
from evolve.
@mhelleborg I need to find a structure easy to use via json or web.config/app.config files for Evolve.MSBuild, or via command line options for Evolve.CLI
So 2 lists of strings separated by ;
seemed a good idea
Thus it implies you cannot filter migrations script by assembly. It is a general filter. That's why at first I thought to allow only one Assembly to avoid confusion
from evolve.
@mhelleborg I think I will going to keep the EmbeddedResourceContext
to avoid confusion with the EmbeddedResourceLocations term used by file migration scripts. So:
- Assembly[]
EmbeddedResourceContexts
: one or several relative or absolute pathes to assemblies to scan - string[]
EmbeddedResourceFilters
: zero or multiple filters to apply when searching for embedded migration scripts
In Evolve.MSBuild or Evolve.CLI those 2 properties will be a list of string where values will be separated by ;
Everyone's ok with that ?
from evolve.
Or...
- EmbeddedResourceAssemblies
- EmbeddedResourceFilters
;)
from evolve.
Related Issues (20)
- [Logging] Documentation missing
- Can command line interface accept password from environment HOT 1
- Bug: Error when trying to migrate large files
- Error: `syntax error at or near "-" at character 30` when running Evolve.Erase()
- [question] how to capture all SQL so that it can be applied by some other tool? HOT 1
- Feature Request: Code-based Migrations
- Allow versions longer than long.MaxValue
- Unable to load shared library 'SQLite.Interop.dll' HOT 5
- Unable to apply migration from two different sql files HOT 1
- Inconsistent behavior in treating paths in Evolve.Evolve() on Windows and Linux HOT 1
- Tool does not work the .NET 7 HOT 2
- Use Microsoft.Data.SqlClient HOT 1
- evolve and Postgres get error "SHOW VARIABLES LIKE '" HOT 4
- [Evolve Exception] CREATE INDEX CONCURRENTLY cannot be executed within a pipeline Sql query: -- evolve-tx-off
- Cannot proceed, because event scheduler is disabled. HOT 1
- Version sorting HOT 1
- Is the timeout capped at 60 seconds somewhere? HOT 5
- Migrate from System.Data.SqlClient to Microsoft.Data.SqlClient
- Netlify docs appear to be down: https://evolve-db.netlify.com shows "Site Not Found" HOT 3
- parallel migration with schema level lock ids
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from evolve.