~shulhan/pakakeh.go

v0.57.0 5 months ago

Release pakakeh.go v0.57.0 (2024-09-03)

=== Breaking changes

* lib/sql: replace [http.FileSystem] with [memfs.MemFS]

  Accepting the [http.FileSystem] means that the parameter can receive
  an instance of [embed.FS], but in most cases, it will fail.

  Case example, when we embed SQL files for migration under
  "db/migration" using the "go:embed" directive,

  	//go:embed db/migration/*.sql
  	var DBMigrationFS embed.FS

  and then call the [Migrate] function, it will not find any ".sql"
  files inside the "/" directory because the files is stored under
  "db/migration/" prefix (also there is no "/" when using embed.FS).

=== Chores

* lib/memfs: document the comparison with "go:embed" directive

  Compare it to "go:embed", the memfs package is more flexible and
  portable. Currently, we found three disadvantages of using "go:embed",

    - The "go:embed" only works if files or directory to be embedded is
      in the same parent directory.
    - Accessing the embedded file require the original path.
    - No development mode.

  None of those limitation affected the memfs package.
Do not follow this link