100
ctx context.Context,
101
request *p.InternalCreateNamespaceRequest,
103
>
104
>
query := m.session.Query(templateCreateNamespaceQuery, request.ID, request.Name).WithContext(ctx)
105
>
existingRow := make(map[string]any)
106
>
applied, err := query.MapScanCAS(existingRow)
107
>
if err != nil {
108
return nil, gocql.ConvertError("CreateNamespace", err)
109
}
110
112
// if the id with the same name exists in `namespaces_by_id`, fall through and either add a row in `namespaces` table
113
// or fail if name exists in that table already. This is to make sure we do not end up with a row in `namespaces_by_id`