spaceandtimelabs / sxt-proof-of-sql

Space and Time | Proof of SQL
Other
2.75k stars 96 forks source link

feat: books example #304

Closed henrymai closed 1 month ago

henrymai commented 1 month ago

Rationale for this change

Add an additional books example to help improve documentation.

What changes are included in this PR?

books example is added.

Are these changes tested?

Yes.

Parsing the query: SELECT COUNT(*) AS total_books FROM books...
Done in 0.380426 ms.
Generating proof...Done in 40.151188 ms.
Verifying proof...Verified in 13.067942 ms.
Query Result:
Ok(OwnedTable { table: {Identifier { name: "total_books" }: BigInt([20])} })
Parsing the query: SELECT title, author, rating FROM books ORDER BY rating DESC LIMIT 5...
Done in 0.542889 ms.
Generating proof...Done in 50.523984 ms.
Verifying proof...Verified in 26.318234999999998 ms.
Query Result:
Ok(OwnedTable { table: {Identifier { name: "title" }: VarChar(["The Lord of the Rings", "Harry Potter and the Philosopher's Stone", "1984", "The Chronicles of Narnia", "The Hobbit"]), Identifier { name: "author" }: VarChar(["J.R.R. Tolkien", "J.K. Rowling", "George Orwell", "C.S. Lewis", "J.R.R. Tolkien"]), Identifier { name: "rating" }: Decimal75(Precision(20), 10, [MontScalar(BigInt([49000000000, 0, 0, 0])), MontScalar(BigInt([48000000000, 0, 0, 0])), MontScalar(BigInt([47000000000, 0, 0, 0])), MontScalar(BigInt([47000000000, 0, 0, 0])), MontScalar(BigInt([46000000000, 0, 0, 0]))])} })
Parsing the query: SELECT genre, COUNT(*) AS book_count FROM books GROUP BY genre ORDER BY book_count DESC...
Done in 0.633289 ms.
Generating proof...Done in 72.832507 ms.
Verifying proof...Verified in 18.07852 ms.
Query Result:
Ok(OwnedTable { table: {Identifier { name: "genre" }: VarChar(["Fiction", "Fantasy", "Science Fiction", "Young Adult", "Adventure", "Horror", "Mystery", "Romance", "Satire", "Thriller"]), Identifier { name: "book_count" }: BigInt([5, 4, 3, 2, 1, 1, 1, 1, 1, 1])} })
Parsing the query: SELECT title, author, publication_year, rating FROM books WHERE publication_year > 2000 AND rating > 4.5...
Done in 0.632869 ms.
Generating proof...Done in 128.548577 ms.
Verifying proof...Verified in 28.727508999999998 ms.
Query Result:
Ok(OwnedTable { table: {Identifier { name: "title" }: VarChar([]), Identifier { name: "author" }: VarChar([]), Identifier { name: "publication_year" }: BigInt([]), Identifier { name: "rating" }: Decimal75(Precision(20), 10, [])} })
github-actions[bot] commented 1 month ago

:tada: This PR is included in version 0.33.11 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: