You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 9, 2023. It is now read-only.
Since 0.19.0, we've been working on support different transform modes for snaplet:
--transform-mode=strict: snaplet will fail creation of the snapshot and tell you which fields are missing from transform.ts
--transform-mode=auto: snapshot tries to automatically transform the data for these fields, currently via copycat.scramble()
--transform-mode=unsafe: snaplet will simply use the production data as is for these fields (the current default behaviour of snaplet)
While this feature is still experimental, we're getting close to having it ready for you use. This release include improvements towards this goal, specifically for --transform-mode=auto ("auto-transform mode"). Some of them might even help outside of just this feature.
Copycat 0.13.0
Since auto-transform mode relies heavily on copycat.scramble(), we need it to work as fast as possible. So we've made some improvements to copycat to make it faster and more secure, for scramble(), and more generally too.
note: For any input given to copycat (for e.g. a column value in each row), the result will be different to what it was in previous releases.
Auto-transforming enums
In this release, we now support enum column types in auto-transform mode. When using snaplet in this mode, if snaplet sees an enum column for which a replacement value has not been defined in transform.ts, it'll choose from the available values for that enum. This is done deterministically - each row's
Truncating large values
In auto-transform mode, if snaplet sees a string value longer than 100 characters, before trying to scramble the value, it first truncates it to 100 characters.
Other improvements
Opting out of parsing json columns
Currently, snaplet parses json values into javascript objects, in order for us to pass it to your transform.ts config - this way you can work with the field as an ordinary javascript object.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Since 0.19.0, we've been working on support different transform modes for snaplet:
--transform-mode=strict: snaplet will fail creation of the snapshot and tell you which fields are missing fromtransform.ts--transform-mode=auto: snapshot tries to automatically transform the data for these fields, currently viacopycat.scramble()--transform-mode=unsafe: snaplet will simply use the production data as is for these fields (the current default behaviour of snaplet)While this feature is still experimental, we're getting close to having it ready for you use. This release include improvements towards this goal, specifically for
--transform-mode=auto("auto-transform mode"). Some of them might even help outside of just this feature.Copycat
0.13.0Since auto-transform mode relies heavily on
copycat.scramble(), we need it to work as fast as possible. So we've made some improvements to copycat to make it faster and more secure, forscramble(), and more generally too.You can read more about these changes here: supabase-community/copycat#36.
note: For any input given to copycat (for e.g. a column value in each row), the result will be different to what it was in previous releases.
Auto-transforming enums
In this release, we now support enum column types in auto-transform mode. When using snaplet in this mode, if snaplet sees an enum column for which a replacement value has not been defined in
transform.ts, it'll choose from the available values for that enum. This is done deterministically - each row'sTruncating large values
In auto-transform mode, if snaplet sees a string value longer than 100 characters, before trying to scramble the value, it first truncates it to 100 characters.
Other improvements
Opting out of parsing
jsoncolumnsCurrently, snaplet parses json values into javascript objects, in order for us to pass it to your
transform.tsconfig - this way you can work with the field as an ordinary javascript object.In some cases though, it might be preferable to avoid snaplet doing this parsing, so that the raw json is given to your
transform.tsinstead:This can for example, be helpful to indicate to snaplet that you're wanting a json
nulland not a postgresnull:Beta Was this translation helpful? Give feedback.
All reactions