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

Firebird services support #145

Merged
merged 59 commits into from
Nov 11, 2024
Merged

Conversation

artyom-smirnov
Copy link
Contributor

Low level services wire protocol implementation and wrappers for backup, nbackup, user and trace management

@artyom-smirnov
Copy link
Contributor Author

This is WIP pull request. Before making it "ready to merge" I want to add maintenance management (repair, sweep, etc) and add some testing. If you have a some time, take a glance. May be you see it somehow different.

@bat22
Copy link

bat22 commented Feb 1, 2023

In my opinion:

  • use int instead of int16 here
type XPBReader struct {
	buf []byte
	pos int16
}
  • Bytes() is more idiomatic name for
func (pb *XPBWriter) GetBuffer() []byte
  • use append() instead of bytes.Join() in XPBWriter (with method Reset() object can be reused with existing buffer)

ps
what does XPB mean?

@artyom-smirnov
Copy link
Contributor Author

artyom-smirnov commented Feb 1, 2023

what does XPB mean?

Just common name for DPB, RPB.

@bat22
Copy link

bat22 commented Feb 3, 2023

I think most likely case for XPBReader.Reset is reset with new byte slice
for example: https://pkg.go.dev/strings#Reader.Reset, https://pkg.go.dev/bytes#Reader.Reset

@nakagami
Copy link
Owner

nakagami commented Feb 18, 2023

Great work!

I don't know much about the service API, but I think the code is good.
Test code is also good.

It would be even better if you could include an example in the README if possible, but I think I will merge it without the README when this work is completed.

@HelioNeto
Copy link

Hello, congratulations on the initiative, it will be great to have the backup/restore directly through the service port. It is now available for use. I tried to "go get" but I can't use it.
Thanks

@artyom-smirnov
Copy link
Contributor Author

Hello, congratulations on the initiative, it will be great to have the backup/restore directly through the service port. It is now available for use. I tried to "go get" but I can't use it. Thanks

Hi! I was bit busy with work and did not finished this patch so this is still WIP. I will be happy if it will be feature which will be useful to someone. Will try to complete work in near time!

@HelioNeto
Copy link

Hi! I was bit busy with work and did not finished this patch so this is still WIP. I will be happy if it will be feature which will be useful to someone. Will try to complete work in near time!

No problem friend, if it's just because of me, don't worry, I'm still testing the Go language and I don't have any real projects yet.
but this feature will add a lot to the community, I already use Firebird in other languages ​​and using the "Service Port" avoids the need to use "gbak".
Thanks again.

artyom-smirnov and others added 22 commits November 8, 2024 12:13
Database shutdown/online
Setting database mode to read-only/read-write
Setting forced writes on/off
Setting dialect of the database
Set the cache size
Mend and repair database
Sweeping database
Activating and removing shadow files
Limbo transactions handling
@artyom-smirnov
Copy link
Contributor Author

artyom-smirnov commented Nov 11, 2024

Shame I have no much time to complete this PR early. I think it mostly complete now. I have added tests and some examples how to work with service manager. @nakagami if it looks OK to you please merge. Will be glad to hear any critics from anyone.

@nakagami
Copy link
Owner

I have been waiting for your pull request, Thank you !

I'm not sure about the service API, but it doesn't seem to harm the existing code, so I'll merge it and wait for feedback from other developpers.

@nakagami nakagami merged commit b98b9d0 into nakagami:master Nov 11, 2024
6 checks passed
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.

4 participants