Comments (17)
Halo mas @LIQRGV, sebenarnya bisa mas, hanya saja kita perlu memikirkan cara membuat agar keturunannya bisa eagerload. Saat ini masih belum pakai eagerload, jadi Kalau tingkat generasi di pohon keluarga tidak dibatasi, takutnya bikin lambat load.
Kecuali (mungkin) kalau kita pakai frontend framework seperti vue, dan tiap anak bisa diload dengan ajax, mungkin bisa efektif. 🤔
from silsilah.
Untuk eagerload ini, gimana kalo data hierarki kita pindahkan ke js aja?
from silsilah.
Itu lebih efektif kaya nya mas, jadi kita malah ngga perlu membatasi lagi. Jadi mirip kaya buka folder di file manager 😀
from silsilah.
@nafiesl, ini eagerload maunya di tingkat database kah atau tingkat js nih ?
from silsilah.
Dan lagi, di tree itu ternyata ada sebutannya:
anak, cucu, cicit, canggah, wareng.
Kalo gak terbatas, gimana ?
from silsilah.
Iya ya, apa bikin route baru aja mas? Misal users/{user}/tree_v2
gitu. Jadi ngga edit2 yang existing.
from silsilah.
Loom video https://www.loom.com/share/6f67327f26cf40e6b2c94712c2d096c0?
https://github.com/LIQRGV/silsilah/tree/allow-infinite-tree-hierarchy
Mau kayak buka folder di file manager? Jadi flow-nya pake ajax, ya ?
Atau mau dikurangi jumlah query-nya ?
from silsilah.
Masih belum yakin mas, tapi nanti boleh kita lihat yang mas bantu bikin seperti apa 🙏 Akan saya cek PR nya juga #39
from silsilah.
Itu WIP sih.
Bakalan berubah tergantung maunya mas gimana.
Haha
from silsilah.
Hoo. oke mas nanti anu-anu dulu PR nya.
from silsilah.
Setelah nyoba-nyoba, ternyata agak berat untuk ngurangin jumlah query.
Jumlah query bisa dikurangi, tapi akan jadi independent ke vendor (Postgres).
https://www.sqlservertutorial.net/sql-server-basics/sql-server-recursive-cte (lihat cte_org
).
Mohon maaf, bukan MySQL fans. 😛
Itupun masih akan ada konsekuensi ke eloquent, kita harus ngerubah cara bacanya di tree.blade
dari $user->childs
jadi
$childIds = getChildFromParent($user);
dimana getChildFromParent
adalah method untuk nyari child diantara collection yang ada, gak akan query lagi.
Cuma ya itu, ribet.
Any thought ?
from silsilah.
Mas @LIQRGV, maaf baru respons, saya udah test ni PR nya #39. Bener seperti mas bilang, sepertinya kalau unlimited tree, kita ngga bisa mengurangi jumlah query.
Ini yang dari view users/tree.blade.php
(145 queries, terbatas 6 generasi).
Ini yang dari view users/tree.blade.php
(217 queries, generasi tidak dibatasi).
Kalau kita ingin jumlah generasi tidak dibatasi, mungkin kita perlu bikin tree view baru dengan frontend library 🤔
Bagian yang paling sulit itu rasanya bikin tampilan cabang pohonnya mas, karena saat ini kita pakai CSS yang server-side 😐
from silsilah.
Btw terkait pindah DBMS ke postgres, saya belum ada gambaran, mas @LIQRGV 🤔
from silsilah.
Btw terkait pindah DBMS ke postgres, saya belum ada gambaran, mas @LIQRGV
Pindah DBMS kayaknya bukan solusi mas.
Vendor lock-in itu ga baik buat opensource.
Wkwkw....
Mungkin bisa tambahin package ini kali ya ?
https://github.com/staudenmeir/laravel-adjacency-list
from silsilah.
Vendor lock-in itu ga baik buat opensource.
😁 saya belum paham maksudnya ini mas.
mas @LIQRGV, saya lihat2 sekilas packagenya laravel-adjacency-list
, sepertinya ini satu model hanya mungkin 1 parent_id
ya 🤔.
getParentKeyName()
Sementara di project ini, untuk nge-list childs/keturunannya kita memungkinkan 2 kolom, father_id
dan mother_id
.
https://github.com/nafiesl/silsilah/blob/master/app/User.php#L105-L112
from silsilah.
I see....
Bener juga yah cuma bisa 1.
Wah, dipikirin lagi deh gimana caranya.
Haha....
from silsilah.
mas @LIQRGV issue ini kita close ya. Thank you mas.
from silsilah.
Related Issues (20)
- Upload maksimal ukuran foto HOT 2
- Upload di cpanel tidak bisa update foto HOT 1
- New Feature: Login with Google HOT 4
- Docker image? HOT 2
- Istri HOT 3
- Cetak HOT 1
- Nama HOT 1
- I have many questions about your project HOT 2
- Search for the fifth or fourth grandfather HOT 1
- Anak Berdasarkan Pernikahan HOT 2
- Can not upload photo profil HOT 1
- Tambah Foto HOT 1
- Menampilkan pasangan di family tree HOT 4
- Eror saat backup database HOT 2
- Tampilan Family Tree berupa foto-foto HOT 4
- Foto Tidak Tampil Setelah Upload ke CPanel HOT 5
- harus login sebelum akses HOT 5
- Tidak bisa menampilkan foto di web HOT 3
- Menampilkan Urutan Anak ke 1 , Anak ke 2 secara berurutan di Family Chart HOT 11
- problem install di terminal cpanel
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 silsilah.