Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Readme wrong examples and texts #126

Open
2 tasks done
kotolex opened this issue Dec 2, 2024 · 1 comment
Open
2 tasks done

Documentation: Readme wrong examples and texts #126

kotolex opened this issue Dec 2, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@kotolex
Copy link

kotolex commented Dec 2, 2024

Description

1)https://github.com/surrealdb/surrealdb.py?tab=readme-ov-file#basic-usage
image

  1. https://github.com/surrealdb/surrealdb.py?tab=readme-ov-file#live-query-notifications wrong example
    it should be
import asyncio

from surrealdb import AsyncSurrealDB
async def handle_notifications():
    db = AsyncSurrealDB(url="ws://localhost:8000")
    await db.connect()
    await db.use("test", "test")
    await db.sign_in("root", "root")
    # Start a live query
    live_id = await db.live("users")

    # Process live notifications
    notifications = await db.live_notifications(live_id)
    while True:
        notification = await notifications.get()
        print(f"Live Notification: {notification}")


# Run the notification handler
asyncio.run(handle_notifications())

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kotolex kotolex added the documentation Improvements or additions to documentation label Dec 2, 2024
@remade
Copy link
Collaborator

remade commented Dec 9, 2024

Thanks for raising this @kotolex. Fix in #129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants