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

Add SQLite storage option as adaptor. #7

Merged
merged 16 commits into from
Jun 11, 2023
Merged

Add SQLite storage option as adaptor. #7

merged 16 commits into from
Jun 11, 2023

Conversation

darron
Copy link
Owner

@darron darron commented Jun 10, 2023

It would make running this simpler if I didn't have an additional DB instance to deal with.

Plus - I've never used SQLite and wanted to try this.

Hoping to use Litestream to keep the DB backed up:

https://litestream.io/

Not sure if this is what I will be running in production BUT it's another adaptor.

@darron darron self-assigned this Jun 10, 2023
@darron darron changed the title Add SQLite storage option. Add SQLite storage option as adaptor. Jun 10, 2023
@darron
Copy link
Owner Author

darron commented Jun 10, 2023

Hmm - faker freaks out with the null.String:

➜  ff git:(sqlite) bin/ff send fake record
time=2023-06-10T16:53:24.215-06:00 level=DEBUG msg=sendFakeRecord url=http://localhost:8080/api/v1/records
panic: reflect.Set: value of type string is not assignable to type null.String

goroutine 1 [running]:
reflect.Value.assignTo({0x101b3d700?, 0x1400039c2b0?, 0x1?}, {0x101914a32, 0xb}, 0x101cb7be0, 0x0)
	/opt/homebrew/Cellar/go/1.20.5/libexec/src/reflect/value.go:3245 +0x208
reflect.Value.Set({0x101cb7be0?, 0x14000130d50?, 0x14000366db8?}, {0x101b3d700?, 0x1400039c2b0?, 0x101ca1600?})
	/opt/homebrew/Cellar/go/1.20.5/libexec/src/reflect/value.go:2236 +0xc8
github.com/go-faker/faker/v4.setDataWithTag({0x101cc0ae0?, 0x14000130d50?, 0x14000128348?}, {0x101b3f5ca, 0x9}, {0x0, 0x0, 0x1400024b9e0, 0x0, 0x1024b8660, ...})
	/Users/darron/src/ff/vendor/github.com/go-faker/faker/v4/faker.go:715 +0x6f0
github.com/go-faker/faker/v4.getFakedValue({0x101ca15a0?, 0x14000130cc0}, 0x1400037fd50)
	/Users/darron/src/ff/vendor/github.com/go-faker/faker/v4/faker.go:469 +0x1b60
github.com/go-faker/faker/v4.getFakedValue({0x101b1bb60?, 0x1400039a030}, 0x1400037fd50)
	/Users/darron/src/ff/vendor/github.com/go-faker/faker/v4/faker.go:507 +0x246c
github.com/go-faker/faker/v4.getFakedValue({0x101d09220?, 0x140003372b0}, 0x1400037fd50)
	/Users/darron/src/ff/vendor/github.com/go-faker/faker/v4/faker.go:457 +0x1b90
github.com/go-faker/faker/v4.getFakedValue({0x101b0a560?, 0x14000337040}, 0x1400037fd50)
	/Users/darron/src/ff/vendor/github.com/go-faker/faker/v4/faker.go:405 +0x1064
github.com/go-faker/faker/v4.FakeData({0x101b0a560?, 0x14000337040}, {0x0?, 0x0?, 0x0?})
	/Users/darron/src/ff/vendor/github.com/go-faker/faker/v4/faker.go:311 +0x26c
github.com/darron/ff/core.FakeRecord()
	/Users/darron/src/ff/core/record.go:49 +0x60
github.com/darron/ff/core.FakeRecordJSON()
	/Users/darron/src/ff/core/record.go:54 +0x24
github.com/darron/ff/cmd.sendFakeRecord(0x1400036fb80)
	/Users/darron/src/ff/cmd/send_fake_record.go:45 +0xd0
github.com/darron/ff/cmd.glob..func9(0x1024c6180?, {0x101906562?, 0x0?, 0x0?})
	/Users/darron/src/ff/cmd/send_fake_record.go:30 +0xf8
github.com/spf13/cobra.(*Command).execute(0x1024c6180, {0x102530f08, 0x0, 0x0})
	/Users/darron/src/ff/vendor/github.com/spf13/cobra/command.go:944 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x1024c4a80)
	/Users/darron/src/ff/vendor/github.com/spf13/cobra/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/darron/src/ff/vendor/github.com/spf13/cobra/command.go:992
github.com/darron/ff/cmd.Execute()
	/Users/darron/src/ff/cmd/root.go:52 +0x28
main.main()
	/Users/darron/src/ff/main.go:8 +0x1c

@darron
Copy link
Owner Author

darron commented Jun 11, 2023

Cool - I'm happy with this:

Screen.Recording.2023-06-10.at.19.45.24.mov

@darron darron merged commit a9c934d into main Jun 11, 2023
@darron darron deleted the sqlite branch June 11, 2023 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant