MCPcopy Create free account
hub / github.com/featureform/featureform / createsqlPrimaryTableQuery

Method createsqlPrimaryTableQuery

provider/sql.go:293–304  ·  view source on GitHub ↗

primaryTableCreate creates a query for table creation based on the specified TableSchema. Returns the query if successful. Returns an error if there is an invalid column type.

(name string, schema TableSchema)

Source from the content-addressed store, hash-verified

291// specified TableSchema. Returns the query if successful. Returns an error
292// if there is an invalid column type.
293func (store *sqlOfflineStore) createsqlPrimaryTableQuery(name string, schema TableSchema) (string, error) {
294 columns := make([]string, 0)
295 for _, column := range schema.Columns {
296 columnType, err := store.query.determineColumnType(column.ValueType)
297 if err != nil {
298 return "", err
299 }
300 columns = append(columns, fmt.Sprintf("%s %s", column.Name, columnType))
301 }
302 columnString := strings.Join(columns, ", ")
303 return store.query.primaryTableCreate(name, columnString), nil
304}
305
306func (store *sqlOfflineStore) GetPrimaryTable(id ResourceID) (PrimaryTable, error) {
307 name, err := GetPrimaryTableName(id)

Callers 1

newsqlPrimaryTableMethod · 0.95

Calls 2

determineColumnTypeMethod · 0.65
primaryTableCreateMethod · 0.65

Tested by

no test coverage detected