discontinuedPackage connect_database has been discontinued.

buildSafely method

Future<Result<String>> buildSafely(
  1. String tableName, {
  2. int maxLobSize = 4000,
  3. bool withNoLock = false,
})

Convenience method to generate a complete simple SELECT FROM table.

Implementation

Future<Result<String>> buildSafely(String tableName,
    {int maxLobSize = 4000, bool withNoLock = false}) async {
  return (await getSafeColumns(tableName, maxLobSize: maxLobSize)).map(
      (cols) =>
          'SELECT $cols FROM $tableName${withNoLock ? ' WITH (NOLOCK)' : ''}');
}