Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Update module github.com/pocketbase/pocketbase to v0.17.0 #238

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 8, 2023

Mend Renovate

This PR contains the following updates:

Package Type Update Change
github.com/pocketbase/pocketbase require minor v0.16.7 -> v0.17.0

⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.


Release Notes

pocketbase/pocketbase (github.com/pocketbase/pocketbase)

v0.17.0

Compare Source

  • New more detailed guides for using PocketBase as framework (both Go and JS).
    If you find any typos or issues with the docs please report them in https://github.com/pocketbase/site.

  • Added new experimental JavaScript app hooks binding via goja.
    They are available by default with the prebuilt executable if you create *.pb.js file(s) in the pb_hooks directory.
    Lower your expectations because the integration comes with some limitations. For more details please check the Extend with JavaScript guide.
    Optionally, you can also enable the JS app hooks as part of a custom Go build for dynamic scripting but you need to register the jsvm plugin manually:

    jsvm.MustRegister(app core.App, config jsvm.Config{})
  • Added Instagram OAuth2 provider (#​2534; thanks @​pnmcosta).

  • Added VK OAuth2 provider (#​2533; thanks @​imperatrona).

  • Added Yandex OAuth2 provider (#​2762; thanks @​imperatrona).

  • Added new fields to core.ServeEvent:

    type ServeEvent struct {
      App    App
      Router *echo.Echo
      // new fields
      Server      *http.Server      // allows adjusting the HTTP server config (global timeouts, TLS options, etc.)
      CertManager *autocert.Manager // allows adjusting the autocert options (cache dir, host policy, etc.)
    }
  • Added record.ExpandedOne(rel) and record.ExpandedAll(rel) helpers to retrieve casted single or multiple expand relations from the already loaded "expand" Record data.

  • Added rule and filter record Dao helpers:

    app.Dao().FindRecordsByFilter("posts", "title ~ 'lorem ipsum' && visible = true", "-created", 10)
    app.Dao().FindFirstRecordByFilter("posts", "slug='test' && active=true")
    app.Dao().CanAccessRecord(record, requestInfo, rule)
  • Added Dao.WithoutHooks() helper to create a new Dao from the current one but without the create/update/delete hooks.

  • Use a default fetch function that will return all relations in case the fetchFunc argument of Dao.ExpandRecord(record, expands, fetchFunc) and Dao.ExpandRecords(records, expands, fetchFunc) is nil.

  • For convenience it is now possible to call Dao.RecordQuery(collectionModelOrIdentifier) with just the collection id or name.
    In case an invalid collection id/name string is passed the query will be resolved with cancelled context error.

  • Refactored apis.ApiError validation errors serialization to allow map[string]error and map[string]any when generating the public safe formatted ApiError.Data.

  • Added support for wrapped API errors (in case Go 1.20+ is used with multiple wrapped errors, the first apis.ApiError takes precedence).

  • Added ?download=1 file query parameter to the file serving endpoint to force the browser to always download the file and not show its preview.

  • Added new utility github.com/pocketbase/pocketbase/tools/template subpackage to assist with rendering HTML templates using the standard Go html/template and text/template syntax.

  • Added types.JsonMap.Get(k) and types.JsonMap.Set(k, v) helpers for the cases where the type aliased direct map access is not allowed (eg. in goja).

  • Soft-deprecated security.NewToken() in favor of security.NewJWT().

  • Hook.Add() and Hook.PreAdd now returns a unique string identifier that could be used to remove the registered hook handler via Hook.Remove(handlerId).

  • Changed the after* hooks to be called right before writing the user response, allowing users to return response errors from the after hooks.
    There is also no longer need for returning explicitly hook.StopPropagtion when writing custom response body in a hook because we will skip the finalizer response body write if a response was already "committed".

  • ⚠️ Renamed *Options{} to Config{} for consistency and replaced the unnecessary pointers with their value equivalent to keep the applied configuration defaults isolated within their function calls:

    old: pocketbase.NewWithConfig(config *pocketbase.Config) *pocketbase.PocketBase
    new: pocketbase.NewWithConfig(config pocketbase.Config) *pocketbase.PocketBase
    
    old: core.NewBaseApp(config *core.BaseAppConfig) *core.BaseApp
    new: core.NewBaseApp(config core.BaseAppConfig) *core.BaseApp
    
    old: apis.Serve(app core.App, options *apis.ServeOptions) error
    new: apis.Serve(app core.App, config apis.ServeConfig) (*http.Server, error)
    
    old: jsvm.MustRegisterMigrations(app core.App, options *jsvm.MigrationsOptions)
    new: jsvm.MustRegister(app core.App, config jsvm.Config)
    
    old: ghupdate.MustRegister(app core.App, rootCmd *cobra.Command, options *ghupdate.Options)
    new: ghupdate.MustRegister(app core.App, rootCmd *cobra.Command, config ghupdate.Config)
    
    old: migratecmd.MustRegister(app core.App, rootCmd *cobra.Command, options *migratecmd.Options)
    new: migratecmd.MustRegister(app core.App, rootCmd *cobra.Command, config migratecmd.Config)
  • ⚠️ Changed the type of subscriptions.Message.Data from string to []byte because Data usually is a json bytes slice anyway.

  • ⚠️ Renamed models.RequestData to models.RequestInfo and soft-deprecated apis.RequestData(c) in favor of apis.RequestInfo(c) to avoid the stuttering with the Data field.
    The old apis.RequestData() method still works to minimize the breaking changes but it is recommended to replace it with apis.RequestInfo(c).

  • ⚠️ Changes to the List/Search APIs

    • Added new query parameter ?skipTotal=1 to skip the COUNT query performed with the list/search actions (#​2965).
      If ?skipTotal=1 is set, the response fields totalItems and totalPages will have -1 value (this is to avoid having different JSON responses and to differentiate from the zero default).
      With the latest JS SDK 0.16+ and Dart SDK v0.11+ versions skipTotal=1 is set by default for the getFirstListItem() and getFullList() requests.

    • The count and regular select statements also now executes concurrently, meaning that we no longer perform normalization over the page parameter and in case the user
      request a page that doesn't exist (eg. ?page=99999999) we'll return empty items array.

    • Reverted the default COUNT column to id as there are some common situations where it can negatively impact the query performance.
      Additionally, from this version we also set PRAGMA temp_store = MEMORY so that also helps with the temp B-TREE creation when id is used.
      There are still scenarios where COUNT queries with rowid executes faster, but the majority of the time when nested relations lookups are used it seems to have the opposite effect (at least based on the benchmarks dataset).

  • ⚠️ Disallowed relations to views from non-view collections (#​3000).
    The change was necessary because I wasn't able to find an efficient way to track view changes and the previous behavior could have too many unexpected side-effects (eg. view with computed ids).
    There is a system migration that will convert the existing view relation fields to json (multiple) and text (single) fields.
    This could be a breaking change if you have relation to view and use expand or some of the relation view fields as part of a collection rule.

  • ⚠️ Added an extra action argument to the Dao hooks to allow skipping the default persist behavior.
    In preparation for the logs generalization, the Dao.After*Func methods now also allow returning an error.

  • Allowed 0 as RelationOptions.MinSelect value to avoid the ambiguity between 0 and non-filled input value (#​2817).

  • Fixed zero-default value not being used if the field is not explicitly set when manually creating records (#​2992).
    Additionally, record.Get(field) will now always return normalized value (the same as in the json serialization) for consistency and to avoid ambiguities with what is stored in the related DB table.
    The schema fields columns DEFAULT definition was also updated for new collections to ensure that NULL values can't be accidentally inserted.

  • Fixed migrate down not returning the correct lastAppliedMigrations() when the stored migration applied time is in seconds.

  • Fixed realtime delete event to be called after the record was deleted from the DB (including transactions and cascade delete operations).

  • Other minor fixes and improvements (typos and grammar fixes, updated dependencies, removed unnecessary 404 error check in the Admin UI, etc.).

v0.16.10

Compare Source

  • Added multiple valued fields (relation, select, file) normalizations to ensure that the zero-default value of a newly created multiple field is applied for already existing data (#​2930).

v0.16.9

Compare Source

  • Register the eagerRequestInfoCache middleware only for the internal api group routes to avoid conflicts with custom route handlers (#​2914).

v0.16.8

Compare Source

  • Fixed unique validator detailed error message not being returned when camelCase field name is used (#​2868).

  • Updated the index parser to allow no space between the table name and the columns list (#​2864).

  • Updated go deps.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from gabe565 as a code owner July 8, 2023 19:04
@renovate renovate bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code patch labels Jul 8, 2023
@renovate renovate bot changed the title ⬆️ Update module github.com/pocketbase/pocketbase to v0.16.8 ⬆️ Update module github.com/pocketbase/pocketbase to v0.16.9 Jul 14, 2023
@renovate renovate bot force-pushed the renovate/github.com-pocketbase-pocketbase-0.x branch from 505fa10 to 36c023f Compare July 14, 2023 10:14
@renovate renovate bot changed the title ⬆️ Update module github.com/pocketbase/pocketbase to v0.16.9 ⬆️ Update module github.com/pocketbase/pocketbase to v0.16.10 Jul 17, 2023
@renovate renovate bot force-pushed the renovate/github.com-pocketbase-pocketbase-0.x branch from 36c023f to dd46743 Compare July 17, 2023 10:13
@renovate renovate bot changed the title ⬆️ Update module github.com/pocketbase/pocketbase to v0.16.10 ⬆️ Update module github.com/pocketbase/pocketbase to v0.17.0 Jul 30, 2023
@renovate renovate bot force-pushed the renovate/github.com-pocketbase-pocketbase-0.x branch from dd46743 to 8eae1e1 Compare July 30, 2023 13:15
@gabe565 gabe565 enabled auto-merge (squash) July 31, 2023 20:44
@gabe565 gabe565 force-pushed the renovate/github.com-pocketbase-pocketbase-0.x branch from ef04cf2 to 4e7e937 Compare July 31, 2023 20:44
@gabe565 gabe565 merged commit deae030 into main Jul 31, 2023
7 checks passed
@gabe565 gabe565 deleted the renovate/github.com-pocketbase-pocketbase-0.x branch July 31, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file go Pull requests that update Go code patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant