func (s *SQL) generateCreateQuery(col string, req *model.CreateRequest) (string, []interface{}, error) {
	dbType := s.dbType
	if dbType == string(model.SQLServer) {
		dbType = string(model.Postgres)
	}
	dialect := goqu.Dialect(dbType)
	query := dialect.From(s.getColName(col)).Prepared(true)
	var insert []interface{}
	if req.Operation == "one" {
		insert = []interface{}{req.Document.(map[string]interface{})}
	} else {
		var ok bool
		insert, ok = req.Document.([]interface{})
		if !ok {
			return "", nil, utils.ErrInvalidParams
		}
	}
	records := []interface{}{}
	for _, temp := range insert {
		record, err := generateRecord(temp)
		if err != nil {
			return "", nil, err
		}
		records = append(records, record)
	}
	sqlQuery, args, err := query.Insert().Rows(records).ToSQL()
	if err != nil {
		return "", nil, err
	}
	sqlQuery = strings.Replace(sqlQuery, "\"", "", -1)
	if s.dbType == string(model.SQLServer) {
		sqlQuery = s.generateQuerySQLServer(sqlQuery)
	}
	return sqlQuery, args, nil
}
generateCreateQuery makes query for create operation
package sql
import (
	"context"
	"strings"
	"github.com/doug-martin/goqu/v8"
	"github.com/spaceuptech/helpers"
	_ "github.com/denisenkom/go-mssqldb"                 
	_ "github.com/doug-martin/goqu/v8/dialect/postgres"  
	_ "github.com/go-sql-driver/mysql"                   
	_ "github.com/lib/pq"                                
	"github.com/spaceuptech/space-cloud/gateway/model"
	"github.com/spaceuptech/space-cloud/gateway/utils"
)
func (s *SQL) Create(ctx context.Context, col string, req *model.CreateRequest) (int64, error) {
	sqlQuery, args, err := s.generateCreateQuery(col, req)
	if err != nil {
		return 0, err
	}
	helpers.Logger.LogDebug(helpers.GetRequestID(ctx), "Executing create query", map[string]interface{}{"sqlQuery": sqlQuery, "queryArgs": args})
	res, err := doExecContext(ctx, sqlQuery, args, s.getClient())
	if err != nil {
		return 0, err
	}
	return res.RowsAffected()
}