Gets the DEFAULT value the column takes as specified in the
 definition, if any

 @return [String, NilClass]
494439
def default_value
      match = if definition =~ /timestamp|datetime/i
                /default '?(.+[^'])'?/i.match(definition)
              else
                /default '?(\w+)'?/i.match(definition)
              end

      return unless match

      match[1].downcase != 'null' ? match[1] : nil
    end
283175
public static function GetColumnDefaultValues (array $options, $table_name, $forced_obtain = false) {
		return static::GetConnection($options)->getColumnDefaultValues($table_name, $forced_obtain);
	}
1061637
def optional(cls):
        
        columns = []
        for column in cls.__table__.columns:  # pylint: disable=no-member
            if column.nullable:
                columns.append(column.name)
        return columns
1082789
def col(col, val = nil)
      if val.nil?
        get_col(col)
      else
        set_col(col, val)
      end
    end
781846
public static String getColumnDefaultValue (Connection conn, String table, String column)
        throws SQLException
    {
        ResultSet rs = getColumnMetaData(conn, table, column);
        try {
            return rs.getString("COLUMN_DEF");
        } finally {
            rs.close();
        }
    }
483924
def get_default_value(self, check):
        
        fun_name, fun_args, fun_kwargs, default = self._parse_with_caching(check)
        if default is None:
            raise KeyError('Check "%s" has no default value.' % check)
        value = self._handle_none(default)
        if value is None:
            return value
        return self._check_value(value, fun_name, fun_args, fun_kwargs)
62724
def raw_default(context)
      value = options.fetch(:default)
      return value unless value.is_a?(Proc)

      case value.arity
      when 1 then context.instance_exec(self, &value)
      else context.instance_exec(&value)
      end
    end
659524
@SuppressWarnings("unchecked")
	public <T> T get(String column, Object defaultValue) {
		Object result = getColumns().get(column);
		return (T)(result != null ? result : defaultValue);
	}
237495
def []=(name, value)
      @column_keys << name
      @attrs[to_key(name)] = value
      define_accessor(name) unless respond_to?(name)
    end
359065
def default(key = self.default_key)
      key = key.to_s if key.is_a?(Symbol)
      if key == self.default_key 
        self['default'] if key?('default')
      else
        hash_default(key)
      end
    end
887861
def defaults=(options)
      @threshold               = options.fetch(:threshold, 100)
      @verbose                 = options.fetch(:verbose, true)
      @path                    = options.fetch(:path, 'lib/**/*.rb')
      @require_exact_threshold = options.fetch(:require_exact_threshold, true)
      @rules                   = options.fetch(:rules, {})
      self.output              = 'measurements/report.txt'
    end
646010
def get_value(self, spec, row):
        
        column = spec.get('column')
        default = spec.get('default')
        if column is None:
            if default is not None:
                return self.convert_type(default, spec)
            return
        value = row.get(column)
        if is_empty(value):
            if default is not None:
                return self.convert_type(default, spec)
            return None
        return self.convert_type(value, spec)
1367800
def GetDefault(self, fd=None, default=None):
    """"""
    if callable(self.default):
      return self.default(fd)

    if self.default is not None:
      # We can't return mutable objects here or the default might change for all
      # objects of this class.
      if isinstance(self.default, rdfvalue.RDFValue):
        default = self.default.Copy()
        default.attribute_instance = self
        return self(default)
      else:
        return self(self.default)

    if isinstance(default, rdfvalue.RDFValue):
      default = default.Copy()
      default.attribute_instance = self

    return default
465980
def [](namespace = :default, index)
      obj = get_setting(namespace, index)
      return obj.read_attribute(setting_value_field) if obj
      SettingsDB::Defaults[namespace, index]
    end
181164
def default_value(self):
        """"""
        if self.name in tsdb_coded_attributes:
            return tsdb_coded_attributes[self.name]
        elif self.datatype == ':integer':
            return -1
        else:
            return ''
1177123
def get(self, key: Any, default: Any = None) -> Any:
        
        if key in self:
            return self[key].value
        return default
173935
def build
      results = [%w[Field Type Null Default]]
      @klass.columns_hash.each do |name, column|
        default = case column.default
        when NilClass then ''
        when TrueClass then '1'
        when FalseClass then '0'
        else column.default
        end
        results << [name, column.sql_type, column.null ? 'YES' : 'NO', default]
      end
      lengths = results.transpose.map { |list| list.max_by { |segment| segment.to_s.length }.length + 1 }
      
      definition = results.map do |line|
        '# ' + line.map.with_index { |segment, index| "| %-#{lengths[index]}s" % segment }.join + "|\n"
      end
      header_line = '# ' + lengths.map { |length| '+' + '-' * (length + 1) }.join + "+\n"
      [header_line, definition.first, header_line] + definition[1..-1] + [header_line]
    end