Closed RohitM-IN closed 1 week ago
A straightforward solution is to introduce a meta column with an object data type, where we can store specific metadata about each column’s functionality.
For instance, if we want a column to support compression, we could store the following in the meta column:
{
"name": "compression"
}
Then, in the middleware selection logic, we can simply iterate over the meta column to identify columns and their associated functionalities, allowing for flexible configuration of column behaviors.
Since you mentioned about your approach, that is also possible. have a look at jsttore encrypt-decrypt plugin.
https://github.com/ujjwalguptaofficial/jsstore-encrypt/blob/main/src/index.ts
in this i encrypt data when inserting and decrypt when selecting with column definition ofcourse.
Let me know if need any help. Both approaches are great - The first approach is thinking more about your db , the second is more generic where you can create a seperate plugin and even launch it on npm.
Discussed in https://github.com/ujjwalguptaofficial/JsStore/discussions/376