Beispiel #1
0
 /// <summary>
 /// The sqlite3_db_readonly(D,N) interface returns 1 if the database N of connection D is read-
 /// only, 0 if it is read/write, or -1 if N is not the name of a database on connection D.
 /// </summary>
 /// <exception cref="ArgumentNullException"> Thrown when one or more required arguments are null. </exception>
 /// <exception cref="ArgumentException"> Thrown when one or more arguments have unsupported or
 ///     illegal values. </exception>
 /// <param name="db"> The database. </param>
 /// <param name="dbName"> Name of the database. </param>
 /// <param name="isMaintenanceDb"> (Optional) True if this object is maintenance database. </param>
 /// <returns> An int. </returns>
 internal int sqlite3_db_readonly(SqliteDatabaseHandle db, string dbName, bool isMaintenanceDb = false)
 {
     if (db == null)
     {
         throw new ArgumentNullException(nameof(db));
     }
     DbProvider.sqlite3 database = (isMaintenanceDb ? db.MaintenanceDb : db.Db)
                                   ?? throw new ArgumentException((isMaintenanceDb
                                         ? "Maintenance mode is specified, but the database is not in Maintenance Mode."
                                         : "The database is in Maintenance Mode, but this was not properly specified."),
                                                                  nameof(isMaintenanceDb));
     return(DbProviderOperations.sqlite3_db_readonly(database, dbName));
 }