Лично, я думаю, что слово "платформа" является чем-то вроде неправильного употребления.
.NET является "платформой", состоя из среды выполнения (виртуальная машина CLR) и ряд библиотек. Это точно походит на Java или Perl или Python (ни один из которых никогда не упоминается как "платформы").
В большинстве случаев, слово "платформа" используется для проектов как Spring или Struts или QT, которые находятся сверху платформы (т.е., не обеспечивая собственной среды выполнения) как библиотека.
, Но в отличие от "библиотеки", платформа стремится переопределить фундаментальные операции базовой платформы. (Внедрение зависимости Spring игнорирует звонящую конструктора логику обычного кода Java. Реализация сигналов-и-слотов QT игнорирует обычный код C++.)
я знаю, что я просто - педантичный ублюдок, но мне.NET не является платформой. Это - платформа.
Вот сценарий удара, который, для всех непустых таблиц в базе данных SQLite (или для всех указанных таблиц в такой базе данных), определяет все-ПУСТЫЕ колонки. Та же техника может использоваться на языке программирования, по Вашему выбору принимающем это, может говорить с базой данных SQLite.
#!/bin/bash
function help {
cat <<EOF
Syntax: [110] databasefile [table ...]
If no tables are specified, then for each non-empty user table in the
specified SQLite database row, this script will emit the column names
of those columns in which all the values are NULL. If any tables are
specified, only the specified tables are scanned.
The script is written to make it easy to modify the criteria and the output.
Thanks to SQL, two passes are required per table, and if no tables are
specified, an additional invocation of sqlite3 is required.
Column names are written in the form: tablename.columnname
Requirements:
sqlite3 on the \$PATH
Options:
-v | --verbose :: emit additional information
EOF
}
while [ "$1" ]
do case "$1" in
-h | --help | "" ) help
exit
;;
-v | --verbose ) VERBOSE=1
shift
;;
* ) break
;;
esac
done
function verbose { if [ "$VERBOSE" ] ; then echo "$@" >&2 ; fi ; }
db="$1"
shift
if [ ! -s "$db" ] ; then echo "[110] : $db not found" ; exit ; fi
# To prevent loading ~/.sqliterc specify -init ""
# Global: db
function nullcolumns {
local table="$1"
local count column field nulls
( read count
if [ -n "$count" ] ; then
verbose "Row count for $table: $count"
if [ "$count" -gt 0 ] ; then
while read column ; do
echo "SELECT '$column', * FROM
(SELECT COUNT(*) FROM $table WHERE '$column' IS NULL);"
done |
sqlite3 -readonly "$db" | while IFS="|" read field nulls ; do
verbose $table.$field ... $nulls
if [ "$nulls" -eq $count ] ; then echo "$table.$field" ; fi
done
else cat > /dev/null
fi
else cat > /dev/null
fi ) < <(sqlite3 -readonly "$db" "select count(*) from '$table';
select name from pragma_table_info( '$table' )")
}
if [ $# = 0 ] ; then
sqlite3 -readonly "$db" .tables | while read table ; do
nullcolumns "$table"
done
else
for table ; do
nullcolumns "$table"
done
fi