Comments (5)
It would be nice to have to support postgres or mysql but I don't think it is worth the development effort. SQLite will work nicely with small userbases and thats exactly for what it was designed (:.
from server.
Please reconsider this @jmattheis.
While SQLite does indeed work nicely with small userbases and all, some users may already have managed database infrastructure in place which they wish to use, for instance because it provides proper backup, etc.
I was able to get Traggo running under Postgres by with minimal changes:
diff --git a/model/all.go b/model/all.go
index 27d2378..a5893ab 100644
--- a/model/all.go
+++ b/model/all.go
@@ -3,8 +3,8 @@ package model
// All returns all schema instances.
func All() []interface{} {
return []interface{}{
- new(TagDefinition),
new(User),
+ new(TagDefinition),
new(Device),
new(TimeSpan),
new(TimeSpanTag),
This makes the migration work, by ensuring that inter-relation dependencies are ordered.
As the code stands now TagDefinition
depends on User
which makes the automigration fail on Postgres.
diff --git a/model/device.go b/model/device.go
index 589ca63..ed8d594 100644
--- a/model/device.go
+++ b/model/device.go
@@ -14,7 +14,7 @@ type Device struct {
Name string
UserID int `gorm:"type:int REFERENCES users(id) ON DELETE CASCADE"`
CreatedAt time.Time
- Type DeviceType
+ Type DeviceType `gorm:"type:bytea"`
ActiveAt time.Time
}
This makes the device lookups work as the code seem to expect byte[]
access.
I expected it to work out of the box, but it does not on Postgres.
I tried to use Gorm's bytes
type, but not in fact work for Postgres, it yields an error that bytes
is not a known type in postgres, so the appropriate type would be bytea
.
This last change is however destructive to SQLite support as SQLite does not have a bytea
type.
I don't know Gorm, so I am not sure how to specify a different type for each database dialect.
from server.
It could be done similar to https://github.com/gotify/server/blob/master/database/database.go#L70, I'm open to accept a PR for this. But please make sure, the statistics endpoint for calculating the dashboard aggregation does work https://github.com/traggo/server/blob/master/statistics/summary.go#L38
from server.
I'm indeed experiencing concurrency issues while deploying traggo in kubernetes. With SQLite & CIFS, and the DB being locked even with a simple pod/container, so I could not make traggo to work with PersistentVolumes.
Did postgres support got implemented in the meanwhile? I would surely be interested
from server.
No, not implemented and likely won't in the future. See explanation in my first comment.
from server.
Related Issues (20)
- Create backup from server data HOT 1
- Integration with Openproject
- Support Arm v8 HOT 2
- Display totals in graphs as hours/mins instead of days/h/m/s HOT 6
- Time entry shift and calendar display issues in Iran timezone after daylight saving removal HOT 4
- going from list view to dashboards wont update the dashboards with the latest changes. HOT 1
- building Dockerfile.dev container from source is failing. HOT 7
- Traggo does not build HOT 2
- Timesheet / List UI is very janky HOT 1
- Feature request: Dashboard Pie Charts - Display percentage instead of hours
- Tag visibility based on start and end dates HOT 2
- CALDAV with traggo HOT 8
- Issues building Traggo v0.4.2 HOT 2
- Backspace deletes the new entry, instead of the typed character HOT 2
- Anyway to import a calander and tag those entries? HOT 3
- Tag Hierarchy allow for sub tags HOT 1
- Reminder to enter what I've been working on HOT 1
- Display aggregate time for a combo of tags HOT 4
- "Weekdays only" option in the calendar view (no Saturday/Sunday) HOT 1
- Error in duration HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from server.