Skip to content

Commit 0b58aef

Browse files
committed
feat(spin_sdk): update modules with latest/spin 4.0.0 imports
Signed-off-by: Vaughn Dice <vdice@akamai.com>
1 parent d91763e commit 0b58aef

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/spin_sdk/key_value.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Module for accessing Spin key-value stores"""
22

3-
from spin_sdk.wit.imports.fermyon_spin_key_value_2_0_0 import Store
3+
from spin_sdk.wit.imports.spin_key_value_key_value_3_0_0 import Store
44

5-
def open(name: str) -> Store:
5+
async def open(name: str) -> Store:
66
"""
77
Open the store with the specified name.
88
@@ -22,7 +22,7 @@ def open(name: str) -> Store:
2222
"""
2323
return Store.open(name)
2424

25-
def open_default() -> Store:
25+
async def open_default() -> Store:
2626
"""
2727
Open the default store.
2828

src/spin_sdk/mqtt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Module for utilizing Spin Outbound MQTT"""
22

33
from enum import Enum
4-
from spin_sdk.wit.imports.fermyon_spin_mqtt_2_0_0 import Connection, Qos as Qos
4+
from spin_sdk.wit.imports.spin_mqtt_mqtt_3_0_0 import Connection, Qos as Qos
55

6-
def open(address: str, username: str, password: str, keep_alive_interval_in_secs: int) -> Connection:
6+
async def open(address: str, username: str, password: str, keep_alive_interval_in_secs: int) -> Connection:
77
"""
88
Open a connection to the Mqtt instance at `address`.
99

src/spin_sdk/postgres.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Module for interacting with a Postgres database"""
22

3-
from spin_sdk.wit.imports.fermyon_spin_postgres_2_0_0 import Connection
3+
from spin_sdk.wit.imports.spin_postgres_postgres_4_2_0 import Connection
44

5-
def open(connection_string: str) -> Connection:
5+
async def open(connection_string: str) -> Connection:
66
"""
77
Open a connection with a Postgres database.
88

src/spin_sdk/redis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Module for interacting with a Redis database"""
22

3-
from spin_sdk.wit.imports.fermyon_spin_redis_2_0_0 import Connection
3+
from spin_sdk.wit.imports.spin_redis_redis_3_0_0 import Connection
44

5-
def open(connection_string: str) -> Connection:
5+
async def open(connection_string: str) -> Connection:
66
"""
77
Open a connection with a Redis database.
88

src/spin_sdk/sqlite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Module for interacting with an SQLite database"""
22

33
from typing import List
4-
from spin_sdk.wit.imports.fermyon_spin_sqlite_2_0_0 import (
4+
from spin_sdk.wit.imports.spin_sqlite_sqlite_3_1_0 import (
55
Connection, Value_Integer, Value_Real, Value_Text, Value_Blob
66
)
77

8-
def open(name: str) -> Connection:
8+
async def open(name: str) -> Connection:
99
"""Open a connection to a named database instance.
1010
1111
If `database` is "default", the default instance is opened.
@@ -20,7 +20,7 @@ def open(name: str) -> Connection:
2020
"""
2121
return Connection.open(name)
2222

23-
def open_default() -> Connection:
23+
async def open_default() -> Connection:
2424
"""Open the default store.
2525
2626
A `componentize_py_types.Err(spin_sdk.wit.imports.sqlite.Error_AccessDenied)` will be raised when the component does not have access to the default database.

src/spin_sdk/variables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Module for interacting with Spin Variables"""
22

3-
from spin_sdk.wit.imports import fermyon_spin_variables_2_0_0 as variables
3+
from spin_sdk.wit.imports import spin_variables_variables_3_0_0 as variables
44

5-
def get(key: str):
5+
async def get(key: str):
66
"""
77
Gets the value of the given key
88
"""

0 commit comments

Comments
 (0)