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

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from

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

@artyom-smirnov artyom-smirnov marked this pull request as ready for review February 10, 2023 11:57
@artyom-smirnov artyom-smirnov marked this pull request as draft February 10, 2023 11:59
artyom-smirnov and others added 23 commits February 16, 2023 12:26
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
@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.

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