shwetasrivastava/Ohana

String values for the insert method

Closed this issue · 1 comments

Hello, @shwetasrivastava.

You need to add validation to the insert method for string values to wrap them in single quotes. When converting an array to a string, quotes are not inserted for string values.

For example, this can be achieved as follows:

./src/functions/insert.js

// before
const values = Object.values(data);

// after
const values = Object.values(data).map(value => {
  if(typeof value === "string" && !!value) return `'${value}'`;
  return value;
});

Regards, Yaroslav.

Hello @Yaroslav-BV

Request you to raise a pull request with the changes.

Thanks,
Shweta