search for: col_is_requir

Displaying 1 result from an estimated 1 matches for "col_is_requir".

Did you mean: col_is_required
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
...:columns def columns( table_name, name=nil ) cols = _real_columns( table_name, name ) cols.each{ |col| sql = "select is_nullable from information_schema.columns where table_name=''#{table_name}'' and column_name=''#{col.name}''" col_is_required = nil log(sql, nil, @connection) { |connection| col_is_required = connection.query(sql)[0][0].downcase != ''yes'' } col.instance_variable_set( :@required, col_is_required ) } end end -- (-, /\ \/ / /\/