toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
      'name': name,
      'type': type.name,
      if (primaryKey) 'primaryKey': true,
      if (notNull) 'notNull': true,
      if (unique) 'unique': true,
      if (autoIncrement) 'autoIncrement': true,
      if (defaultValue != null) 'default': defaultValue,
      if (defaultExprSql != null) 'defaultExpr': defaultExprSql,
      if (checkExprSql != null) 'check': checkExprSql,
      if (references != null) 'references': references!.toJson(),
      if (generatedExprSql != null) 'generated': generatedExprSql,
      if (generatedStored) 'generatedStored': true,
      if (vectorSpec != null) 'vectorSpec': vectorSpec,
    };