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

surreal: added examples folder #5

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ivorytoast
Copy link

@ivorytoast ivorytoast commented Sep 16, 2022

This PR is meant to add an examples/ folder that contains a main.go file that can be run immediately after first cloning the repo locally. I actually followed along with: https://surrealdb.com/blog/getting-started-with-surrealdb so if someone was watching the video, they could see everything the Youtuber did in Golang. Of course, the whole video is not moved over, it is about the first 10 minutes.

I also added a SchemalessSelect function which returns "rows" instead of a list of maps.

Also, will update once #3 gets merged to reflect the latest functionality

examples/main.go Outdated Show resolved Hide resolved
db.go Outdated Show resolved Hide resolved
db.go Outdated Show resolved Hide resolved
@ivorytoast ivorytoast requested review from intabulas and AYM1607 and removed request for intabulas and AYM1607 September 20, 2022 20:12
db.go Outdated Show resolved Hide resolved
db.go Outdated Show resolved Hide resolved
db.go Outdated Show resolved Hide resolved
db.go Outdated Show resolved Hide resolved
@ivorytoast ivorytoast requested review from Keitio and removed request for intabulas September 23, 2022 18:08
@phughk phughk self-assigned this Mar 7, 2023
@phughk phughk added the enhancement New feature or request label Mar 9, 2023
@phughk phughk added the stale label Apr 30, 2023
@timpratim
Copy link
Contributor

Can you please remerge this PR?

@@ -147,6 +147,27 @@ func (self *DB) Query(sql string, vars interface{}) (interface{}, error) {
return self.send("query", sql, vars)
}

// SchemalessSelect returns a list of rows from the database that have been added
// to a table without a defined schema
func (self *DB) SchemalessSelect(what string) ([]map[string]any, error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per Go conversions this should just be db. self and this is not used in Go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants