<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pakakeh.go/lib/sql/client.go, branch dev</title>
<subtitle>Collections of packages and tools for working with Go programming language.</subtitle>
<id>http://git.kilabit.info/pakakeh.go/atom?h=dev</id>
<link rel='self' href='http://git.kilabit.info/pakakeh.go/atom?h=dev'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/'/>
<updated>2026-04-07T14:56:16Z</updated>
<entry>
<title>lib/sql: add method Meta to Client</title>
<updated>2026-04-07T14:56:16Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2026-04-07T14:56:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=6874d73f26a1b68e44c04a55c29cd0e82244e5f0'/>
<id>urn:sha1:6874d73f26a1b68e44c04a55c29cd0e82244e5f0</id>
<content type='text'>
The Meta method returns new instance of [Meta] based on the current
client driver and kind arugment.

While at it, update comments on most methods to use adjectives.
</content>
</entry>
<entry>
<title>all: convert license and copyright to use SPDX identifiers</title>
<updated>2026-01-15T10:26:33Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2026-01-15T10:14:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=7db8c302e1396eda40cd6a1e57f58ed791448556'/>
<id>urn:sha1:7db8c302e1396eda40cd6a1e57f58ed791448556</id>
<content type='text'>
With help of spdxconv tool [1], we able to bulk update all files license
and copyright format to comply with SPDX formats.

[1] https://kilabit.info/project/spdxconv/
</content>
</entry>
<entry>
<title>lib/sql: replace [http.FileSystem] with [memfs.MemFS]</title>
<updated>2024-08-09T09:34:57Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-08-09T09:34:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=437d1090ef8b94b8de784eb27f2cf85bcfc1fc6e'/>
<id>urn:sha1:437d1090ef8b94b8de784eb27f2cf85bcfc1fc6e</id>
<content type='text'>
Accepting the [http.FileSystem] means that the parameter can receive an
instance of [embed.FS], but in most cases, it will fail.

Case example, when we embed SQL files for migration under
"db/migration" using the "go:embed" directive,

	//go:embed db/migration/*.sql
	var DBMigrationFS embed.FS

and then call the [Migrate] function, it will not found any ".sql" files
inside the "/" directory because the files is stored under
"db/migration/" prefix (also there is no "/" when using embed.FS).
</content>
</entry>
<entry>
<title>all: comply with linter recommendations #2</title>
<updated>2024-03-05T07:53:12Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-03-02T21:59:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=2fa7605727e90ca323b7b24168632e485d74c583'/>
<id>urn:sha1:2fa7605727e90ca323b7b24168632e485d74c583</id>
<content type='text'>
HTTP request now implicitly create request with context.

Any false positive related to not closing HTTP response body has been
annotated with "nolint:bodyclose".

In the example code, use consistent "// Output:" comment format, by
prefixing with single space.
Any comment on code now also prefixing with single space.

An error returned without variables now use [errors.New] instead of
[fmt.Errorf].
Any error returned using [fmt.Errorf] now wrapped using "%w" instead of
"%s".
Also, replace error checking using [errors.Is] or [errors.As], instead
of using equal/not-equal operator.

Any statement like "x = x OP y" now replaced with "x OP= y".
Also, swap statement is simplified using "x, y = y, x".
Any switch statement with single case now replaced with if-condition.

Any call to defer on function or program that call [os.Exit], now
replaced by calling the deferred function directly.

Any if-else condition now replaced with switch statement, if possible.
</content>
</entry>
<entry>
<title>all: move the repository to "git.sr.ht/~shulhan/pakakeh.go"</title>
<updated>2024-03-02T08:59:46Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2024-03-01T20:07:33Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=901c9803e6f93e0d5ee282f4061309022c46f490'/>
<id>urn:sha1:901c9803e6f93e0d5ee282f4061309022c46f490</id>
<content type='text'>
There are several reasons that why we move from github.com.

First, related to the name of package.
We accidentally name the package with "share" a common word in English
that does not reflect the content of repository.
By moving to other repository, we can rename it to better and unique
name, in this "pakakeh.go".
Pakakeh is Minang word for tools, and ".go" suffix indicate that the
repository related to Go programming language.

Second, supporting open source.
The new repository is hosted under sourcehut.org, the founder is known
to support open source, and all their services are licensed under AGPL,
unlike GitHub that are closed sources.

Third, regarding GitHub CoPilot.
The GitHub Terms of Service [1], allow any public content that are hosted
there granted them to parse the content.
On one side, GitHub helps and flourish the open source, but on another
side have an issues regarding scraping the copyleft license [2].

[1]: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#4-license-grant-to-us
[2]: https://githubcopilotinvestigation.com
</content>
</entry>
<entry>
<title>all: reformat all codes using gofmt 1.19 (the Go tip)</title>
<updated>2022-05-09T14:54:02Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-05-09T14:54:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=0c9abc1a962955dd0b795a422958c5445145d54c'/>
<id>urn:sha1:0c9abc1a962955dd0b795a422958c5445145d54c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>all: replace any usage of ioutil package with os or io</title>
<updated>2022-04-05T19:37:22Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-04-05T18:40:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=429a9d9205bad2be34cdfe7fb5b1a9a6f127f541'/>
<id>urn:sha1:429a9d9205bad2be34cdfe7fb5b1a9a6f127f541</id>
<content type='text'>
Since Go 1.16, the ioutil package has been deprecated.
This changes replace any usage that use functions from ioutil package
with their replacement from package os or package io.
</content>
</entry>
<entry>
<title>lib/sql: make the table migration customizable</title>
<updated>2022-01-19T08:58:46Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2022-01-19T08:58:46Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=d305d1baaff3b1800be6e592de710b824ae06bc1'/>
<id>urn:sha1:d305d1baaff3b1800be6e592de710b824ae06bc1</id>
<content type='text'>
In the method Migrate() we add parameter "tableMigration" which define
the name of table where the state of migration will be saved.

If its empty default to "_migration".
</content>
</entry>
<entry>
<title>lib/sql: make the TruncateTable run with cascade and restart identity</title>
<updated>2021-12-25T18:32:03Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2021-12-25T18:32:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=682c9326cc717ac5b698f36f8d46cfbb394cd4a6'/>
<id>urn:sha1:682c9326cc717ac5b698f36f8d46cfbb394cd4a6</id>
<content type='text'>
On table that contains foreign key, truncate without cascade may cause
the method fail.

Also, since TruncateTable is, and should be only, used on testing, any
identity columns, for example serial, should be reset back to its initial
value. On PostgreSQL this means the truncate table is with
"RESTART IDENTITY".
</content>
</entry>
<entry>
<title>lib/sql: check for EOF on loadSQL</title>
<updated>2021-12-16T16:01:05Z</updated>
<author>
<name>Shulhan</name>
<email>ms@kilabit.info</email>
</author>
<published>2021-12-16T16:01:05Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/pakakeh.go/commit/?id=5adf8d6c75a5f143f3a6da7f40b06ece699ae0d4'/>
<id>urn:sha1:5adf8d6c75a5f143f3a6da7f40b06ece699ae0d4</id>
<content type='text'>
There is probably a regression in Go that cause ioutil.ReadAll return
io.EOF, while it should not, because the documentation said that

  A successful call returns err == nil, not err == EOF.

But in this, using http.FileSystem, the ioutil.ReadAll now return EOF
and we need to check it to make the migration can run without an error.
</content>
</entry>
</feed>
