Repository: frictionlessdata/frictionless-py (language: python)

Issue:
Sql Format documentation needs update when reading from a database
# Overview

In `frictionless` [Sql Format docs](https://framework.frictionlessdata.io/docs/formats/sql.html) the code snippet for reading a data package from a SQL database is 

```python
from frictionless import Package
package = Package.from_sql('postgresql://database')
```

which generates the error `AttributeError: type object 'Package' has no attribute 'from_sql'`. The correct way (at least in version 5.10.5) is simply:

```python
from frictionless import Package
package = Package('postgresql://database')
```


Discussion / hints:
Thanks @fjuniorr for reporting!

Fix patch:
diff --git a/docs/formats/sql.md b/docs/formats/sql.md
index 75430ca592..9a4e5e2cba 100644
--- a/docs/formats/sql.md
+++ b/docs/formats/sql.md
@@ -15,7 +15,7 @@ You can read SQL database:
 from pprint import pprint
 from frictionless import Package
 
-package = Package.from_sql('postgresql://database')
+package = Package('postgresql://database')
 pprint(package)
 for resource in package.resources:
   pprint(resource.read_rows())


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index 0761fc9489..1d661de360 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -36,6 +36,27 @@ def database_url(sqlite_url):
     yield sqlite_url
 
 
+@pytest.fixture
+def pg_database_url(postgresql_url):
+    engine = sa.create_engine(postgresql_url)
+    with engine.begin() as conn:
+        conn.execute(
+            sa.text("CREATE TABLE languages (id INTEGER PRIMARY KEY, name TEXT)")
+        )
+        conn.execute(sa.text("INSERT INTO languages VALUES (1, 'english'), (2, '中国人')"))
+        conn.execute(
+            sa.text(
+                "CREATE TABLE fruits (uid INTEGER PRIMARY KEY, fruit_name TEXT, calories INTEGER)"
+            )
+        )
+        conn.execute(
+            sa.text(
+                "INSERT INTO fruits VALUES (1, 'Apples', 200), (2, 'Oranges中国人', 350)"
+            )
+        )
+    yield postgresql_url
+
+
 @pytest.fixture
 def sqlite_url(tmpdir):
     path = str(tmpdir.join("database.db"))
diff --git a/tests/formats/sql/databases/postgres/test_parser.py b/tests/formats/sql/databases/postgres/test_parser.py
index 430327e5e2..ec200a8773 100644
--- a/tests/formats/sql/databases/postgres/test_parser.py
+++ b/tests/formats/sql/databases/postgres/test_parser.py
@@ -1,12 +1,20 @@
 import pytest
 from datetime import datetime, time
-from frictionless import formats, platform
+from frictionless import formats, platform, Package
 from frictionless.resources import TableResource
 
 
 # General
 
 
+@pytest.mark.skipif(platform.type == "darwin", reason="Skip SQL test in MacOS")
+@pytest.mark.skipif(platform.type == "windows", reason="Skip SQL test in Windows")
+def test_sql_parser_read(pg_database_url):
+    package = Package(pg_database_url)
+    assert len(package.resources) == 2
+    assert package.resources[0].name == "fruits"
+
+
 @pytest.mark.skipif(platform.type == "darwin", reason="Skip SQL test in MacOS")
 @pytest.mark.skipif(platform.type == "windows", reason="Skip SQL test in Windows")
 def test_sql_parser_write_timezone_postgresql(postgresql_url):