inserts geojson features into the feature column of the given table
975561
function(table, feature, i){
    return 'insert into "'+table+'" (feature) VALUES (\''+JSON.stringify(feature).replace(/'/g, "").replace(/\(\)/g,'')+'\');';
  }
932869
def _insert(self, feature, cursor):
        
        try:
            cursor.execute(constants._INSERT, feature.astuple())
        except sqlite3.ProgrammingError:
            cursor.execute(
                constants._INSERT, feature.astuple(self.default_encoding))
362649
public void addColumn(FastTrackColumn column)
   {
      FastTrackField type = column.getType();
      Object[] data = column.getData();
      for (int index = 0; index < data.length; index++)
      {
         MapRow row = getRow(index);
         row.getMap().put(type, data[index]);
      }
   }
210105
def read_geojson(filename):
    
    json_file = open(filename)
    data = json.load(json_file)
    json_file.close()
    times = data["properties"]["times"]
    main_data = dict(timesteps=[], masks=[], x=[], y=[], i=[], j=[])
    attribute_data = dict()
    for feature in data["features"]:
        for main_name in main_data.keys():
            main_data[main_name].append(np.array(feature["properties"][main_name]))
        for k, v in feature["properties"]["attributes"].items():
            if k not in attribute_data.keys():
                attribute_data[k] = [np.array(v)]
            else:
                attribute_data[k].append(np.array(v))
    kwargs = {}
    for kw in ["dx", "step", "u", "v"]:
        if kw in data["properties"].keys():
            kwargs[kw] = data["properties"][kw]
    sto = STObject(main_data["timesteps"], main_data["masks"], main_data["x"], main_data["y"],
                   main_data["i"], main_data["j"], times[0], times[-1], **kwargs)
    for k, v in attribute_data.items():
        sto.attributes[k] = v
    return sto
853377
private void placeTVEsinColumns () {
        // Build the association between the table column with its index
        Map<AbstractExpression, Integer> aggTableIndexMap = new HashMap<>();
        Map<Integer, ParsedColInfo> indexToColumnMap = new HashMap<>();
        int index = 0;
        for (ParsedColInfo col : m_aggResultColumns) {
            aggTableIndexMap.put(col.m_expression, index);
            if (col.m_alias == null) {
                // hack any unique string
                col.m_alias = "$$_" +
                        col.m_expression.getExpressionType().symbol() +
                        "_$$_" +
                        index;
            }
            indexToColumnMap.put(index, col);
            index++;
        }

        // Replace TVE for group by columns
        m_groupByExpressions = new HashMap<>();
        for (ParsedColInfo groupbyCol : m_groupByColumns) {
            AbstractExpression expr = groupbyCol.m_expression;
            assert(aggTableIndexMap.get(expr) != null);

            expr = expr.replaceWithTVE(aggTableIndexMap, indexToColumnMap);
            m_groupByExpressions.put(groupbyCol.m_alias, expr);
        }

        if (m_having != null) {
            m_having = m_having.replaceWithTVE(aggTableIndexMap, indexToColumnMap);
            ExpressionUtil.finalizeValueTypes(m_having);
        }

        // Replace TVE for display columns
        m_projectSchema = new NodeSchema();
        for (ParsedColInfo col : m_displayColumns) {
            AbstractExpression expr = col.m_expression;
            if (hasComplexAgg()) {
                expr = expr.replaceWithTVE(aggTableIndexMap, indexToColumnMap);
            }
            m_projectSchema.addColumn(col.m_tableName, col.m_tableAlias,
                    col.m_columnName, col.m_alias,
                    expr, col.m_differentiator);
        }

        // DISTINCT group by expressions are already TVEs when set

        placeTVEsForOrderby(aggTableIndexMap, indexToColumnMap);
    }
292207
function createColumnsFromProperties(){
    var res = [];
    for (var i = 0; i < nodeProperties.length; ++i){
        var prop = nodeProperties[i];
        var obj = {
            id: prop,
            name: prop,
            field: prop
        };
        res.push(obj);
    }
    return res;
}
756413
def AddTableColumn(self, table, column):
    """"""
    if column not in self._table_columns[table]:
      self._table_columns[table].append(column)
1254096
function( key, geojson, layerId, callback ){
    var self = this;
    var info = {},
      count = 0;
      error = null;

      info.name = geojson.name ;
      info.updated_at = geojson.updated_at;
      info.expires_at = geojson.expires_at;
      info.retrieved_at = geojson.retrieved_at;
      info.status = geojson.status;
      info.format = geojson.format;
      info.sha = geojson.sha;
      info.info = geojson.info;

      var table = key+':'+layerId;

      self._createTable( table, self._buildSchemaFromFeature(), function(err){

        // insert each feature
        if ( geojson.length ){
          geojson = geojson[0];
        }
        geojson.features.forEach(function(feature, i){
          self._run(self._insertFeature(table, feature, i), function(err){
          });
        });

        // TODO Why not use an update query here?
        self._run( 'delete from "'+self.infoTable+'" where id=\''+table+':info\'', function(err){
          self._run( 'insert into "'+self.infoTable+'" values (\''+table+':info\',\''+JSON.stringify(info).replace(/'/g,'')+'\')', function(err){
            callback(err, true);
          });
        });
      });

  }
285945
function validateGeoJson(geoJson) {
  if (!geoJson)
    throw new Error('No geojson passed');

  if (geoJson.type !== 'FeatureCollection' &&
    geoJson.type !== 'GeometryCollection' &&
    geoJson.type !== 'MultiLineString' &&
    geoJson.type !== 'LineString' &&
    geoJson.type !== 'Feature'
  )
    throw new Error(`Invalid input type '${geoJson.type}'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature`);
}
628670
function stringify (gj) {
  if (gj.type === 'Feature') {
    gj = gj.geometry;
  }

  function pairWKT (c) {
    return c.join(' ');
  }

  function ringWKT (r) {
    return r.map(pairWKT).join(', ');
  }

  function ringsWKT (r) {
    return r.map(ringWKT).map(wrapParens).join(', ');
  }

  function multiRingsWKT (r) {
    return r.map(ringsWKT).map(wrapParens).join(', ');
  }

  function wrapParens (s) { return '(' + s + ')'; }

  switch (gj.type) {
    case 'Point':
      return 'POINT (' + pairWKT(gj.coordinates) + ')';
    case 'LineString':
      return 'LINESTRING (' + ringWKT(gj.coordinates) + ')';
    case 'Polygon':
      return 'POLYGON (' + ringsWKT(gj.coordinates) + ')';
    case 'MultiPoint':
      return 'MULTIPOINT (' + ringWKT(gj.coordinates) + ')';
    case 'MultiPolygon':
      return 'MULTIPOLYGON (' + multiRingsWKT(gj.coordinates) + ')';
    case 'MultiLineString':
      return 'MULTILINESTRING (' + ringsWKT(gj.coordinates) + ')';
    case 'GeometryCollection':
      return 'GEOMETRYCOLLECTION (' + gj.geometries.map(stringify).join(', ') + ')';
    default:
      throw new Error('stringify requires a valid GeoJSON Feature or geometry object as input');
  }
}
1019542
def insert_into_table(table, data):
    

    fields = data['fields']
    fields['date'] = datetime.datetime.now().date()

    query = '('

    for key in fields.keys():
        query += key + ','

    query = query[:-1:] + ")"

    client.execute(f"INSERT INTO {table} {query} VALUES", [tuple(fields.values())])
723435
public void addMapMetadataShape(GoogleMapShape mapShape, long featureId, String database, String table) {
        FeatureShape featureShape = getFeatureShape(database, table, featureId);
        featureShape.addMetadataShape(mapShape);
    }
361980
function insert (model) {
    var insert = model.insertDelayed && model.engine === 'MyISAM' ? 'INSERT DELAYED' : 'INSERT'
    var columns = _.map(model.insertColumnNames, quoteName).join(', ')
    var values = _.map(model.insertColumnNames, columnName => placeholder(model, columnName, model.columns[columnName])).join(', ')
    return `${insert} INTO ${quoteName(model.name)} (${columns}) VALUES(${values})`
}
138797
function (table) {
        table
            .onBodyAdd(this.setWidth.bind(this))
            .onColumnAdded(this.onColumnAdded.bind(this))
            .onColumnPropertyChanged(this.onColumnPropertyChanged.bind(this));
    }
111351
def insert(self, table, data_list, return_cols='id'):
        
        data_list = copy.deepcopy(data_list)  # Create deepcopy so the original list does not get modified
        # Make sure that `data_list` is a list
        if not isinstance(data_list, list):
            data_list = [data_list]
        # Make sure data_list has content
        if len(data_list) == 0:
            # No need to continue
            return []

        # Data in the list must be dicts (just check the first one)
        if not isinstance(data_list[0], dict):
            logger.critical("Data must be a list of dicts")
            # Do not return here, let the exception handle the error that will be thrown when the query runs

        # Make sure return_cols is a list
        if return_cols is None or len(return_cols) == 0 or return_cols[0] is None:
            return_cols = ''
        elif not isinstance(return_cols, list):
            return_cols = [return_cols]

        if len(return_cols) > 0:
            return_cols = 'RETURNING ' + ','.join(return_cols)

        try:
            with self.getcursor() as cur:
                query = "INSERT INTO {table} ({fields}) VALUES {values} {return_cols}"\
                        .format(table=table,
                                fields='"{0}"'.format('", "'.join(data_list[0].keys())),
                                values=','.join(['%s'] * len(data_list)),
                                return_cols=return_cols,
                                )
                values = []
                for row in [tuple(v.values()) for v in data_list]:
                    values.append(_check_values(row))

                query = cur.mogrify(query, values)
                cur.execute(query)

                try:
                    return cur.fetchall()
                except Exception:
                    return None

        except Exception as e:
            logger.exception("Error inserting data")
            logger.debug("Error inserting data: {data}".format(data=data_list))
            raise e.with_traceback(sys.exc_info()[2])
147631
public int[] columnMapping( String[] features ) {
    int[] map = new int[_colNames.length];
    for( int i=0; i<_colNames.length; i++ ) {
      map[i] = -1;              // Assume it is missing
      for( int j=0; j<features.length; j++ ) {
        if( _colNames[i].equals(features[j]) ) {
          if( map[i] != -1 ) throw new IllegalArgumentException("duplicate feature "+_colNames[i]);
          map[i] = j;
        }
      }
      if( map[i] == -1 ) Log.warn(Sys.SCORM,"Model feature "+_colNames[i]+" not in the provided feature list from the data");
    }
    return map;
  }
38241
def insert(self, table, columns, rows):
        
        cursor = self.conn.cursor()
        if len(rows):
            templ, _args = match('INSERT INTO ?s (?S) VALUES (?X)',
                                 table, columns, rows[0])
            cursor.executemany(templ, rows)
        return cursor