Coder Social home page Coder Social logo

schema's People

Contributors

adlio avatar dependabot[bot] avatar kalafut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

schema's Issues

sqlite support

Hi!

I was working on adding SQLite support. It is all pretty straightforward except for locking. While I can work to add a lock scheme, it's necessarily going to involve polling to try to write the sentinel value, checking I got the lock, handling stale locks, etc. My thought: is it worth it for SQLite? Given the use cases of SQLite, that there can only be one writer, and the migrations are done in a transaction, I think anything beyond a no-op ("") lock/unlock is of questionable value. What do you think?

File-based migrations are not cross-platform (due to path separator differences)

(v1.1.7) file.go uses "path" instead of "path/filepath" for a few path-related operations.

Because Windows uses a backslash for the path separator, the file path is not properly interpreted. This results in the migration ID to include the entire absolute path instead of just the filename.

Two functions are involved: MigrationIDFromFilename and MigrationsFromDirectoryPath.

Changing the following appears to correct the problem (although only tested under Windows):

path.Base() to filepath.Base()
path.Ext() to filepath.Ext()
path.Join() to filepath.Join()

Receiver type change breaks use of constructed Migrator

Commit a7bc68f appears to have changed the methods of the Migrator type to accept a pointer rather than a value. The NewMigrator constructor, however, still returns a Migrator by value, which means that a call like:

err := schema.NewMigrator().Apply(x, y)

(which used to work) will now fail because the Migrator is in a temporary and the compiler will not desugar the address.

For now I can work around this by rewriting expressions like the above as:

m := schema.NewMigrator()
err := m.Apply(x, y)

but I think the value returned by the constructor should have the correct type for use by the methods.

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.