in src/main/java/software/amazon/documentdb/jdbc/DocumentDbDatabaseMetaDataResultSets.java [865:1001]
static ImmutableList<JdbcColumnMetaData> buildColumnPrivilegesColumnMetaData(
final String schemaName) {
if (columnPrivilegesColumnMetaData == null) {
// 1. TABLE_CAT String => table catalog (may be null)
// 2. TABLE_SCHEM String => table schema (may be null)
// 3. TABLE_NAME String => table name
// 4. COLUMN_NAME String => column name
// 5. GRANTOR String => grantor of access (may be null)
// 6. GRANTEE String => grantee of access
// 7. PRIVILEGE String => name of access (SELECT, INSERT, UPDATE, REFRENCES, ...)
// 8. IS_GRANTABLE String => "YES" if grantee is permitted to grant to others; "NO" if not; null if unknown
int ordinal = 0;
columnPrivilegesColumnMetaData = ImmutableList.<JdbcColumnMetaData>builder()
.add(new JdbcColumnMetaData(
ordinal++,
true, //caseSensitive,
ResultSetMetaData.columnNullable, //nullable,
false, //signed,
64, //displaySize,
"TABLE_CAT", //label,
"TABLE_CAT", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.add(new JdbcColumnMetaData(
ordinal++,
true, //caseSensitive,
ResultSetMetaData.columnNullable, //nullable,
false, //signed,
64, //displaySize,
"TABLE_SCHEM", //label,
"TABLE_SCHEM", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.add(new JdbcColumnMetaData(
ordinal++,
true, //caseSensitive,
ResultSetMetaData.columnNoNulls, //nullable,
false, //signed,
64, //displaySize,
"TABLE_NAME", //label,
"TABLE_NAME", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.add(new JdbcColumnMetaData(
ordinal++,
true, //caseSensitive,
ResultSetMetaData.columnNoNulls, //nullable,
false, //signed,
64, //displaySize,
"COLUMN_NAME", //label,
"COLUMN_NAME", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.add(new JdbcColumnMetaData(
ordinal++,
true, //caseSensitive,
ResultSetMetaData.columnNullable, //nullable,
false, //signed,
64, //displaySize,
"GRANTOR", //label,
"GRANTOR", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.add(new JdbcColumnMetaData(
ordinal++,
true, //caseSensitive,
ResultSetMetaData.columnNoNulls, //nullable,
false, //signed,
64, //displaySize,
"GRANTEE", //label,
"GRANTEE", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.add(new JdbcColumnMetaData(
ordinal++,
true, //caseSensitive,
ResultSetMetaData.columnNoNulls, //nullable,
false, //signed,
64, //displaySize,
"PRIVILEGE", //label,
"PRIVILEGE", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.add(new JdbcColumnMetaData(
ordinal, // not incremented
true, //caseSensitive,
ResultSetMetaData.columnNullable, //nullable,
false, //signed,
64, //displaySize,
"IS_GRANTABLE", //label,
"IS_GRANTABLE", //columnName,
schemaName, //schemaName,
0, //precision,
0, //scale,
Types.VARCHAR, //type.id,
JdbcType.VARCHAR.name(), //type.name,
String.class.getName()) //columnClassName
)
.build();
}
return columnPrivilegesColumnMetaData;
}