protected function determineLastInsertId(callable $callback, $sequenceName)
	{
		try
		{
			switch($this->driverName)
			{
				case DB::DRIVER_MYSQL:
				case DB::DRIVER_SQLITE:
					return (int)$callback();
				case DB::DRIVER_POSTGRESQL:
					if(is_array($sequenceName))
					{
						$stmt = $this->prepare("SELECT currval(pg_get_serial_sequence(:table, :col))");
						$stmt->bindValue('table', $this->prepareSql($sequenceName[0]));
						$stmt->bindValue('col', $sequenceName[1]);
						$stmt->execute();
							
						return (int)$stmt->fetchNextColumn(0);
					}
					return $callback($this->prepareSql($sequenceName));
				case DB::DRIVER_MYSQL:
					$stmt = $this->prepare("SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int)");
					$stmt->execute();
						
					return (int)$stmt->fetchNextColumn(0);
			}
		
			return (int)$callback($this->prepareSql($sequenceName));
		}
		catch(\Exception $e)
		{
			throw $this->convertException($e);
		}
	}