Comments (6)
Automated discovery has to balance thoroughness with efficiency. A serious project implementing Schemas will likely want to provide explicit definitions instead of relying on the discovery, but the truth is that most projects will not, nor will they pre-cache, so we have to keep the discovery efficient. I think a full filesystem scan could definitely catch more, but it will be costly.
It might be a good addition as a CLI argument or something, where we could guarantee the full load was only happening in a setting where some user was waiting for a response.
from codeigniter4-schemas.
You're right, the goal should be explicit definitions eventually, but thats not gonna happen for everyone.
For me, I've turned off automatic drafting totally and set the cache lifetime of the schema to never expire, as I don't really see any use in having it autoamtically redrafted every x hours or so, except that drafting might fail for some reason at sometime and crash the whole site. Therefore I only redraft the schema from a specific controller manually, by cleaning schemas chache beforehand.
However, with the potential new model drafter using Factories, autodiscovery might become a completely different topic anyways :)
from codeigniter4-schemas.
I think that's a brilliant way to do it. I would probably do it via Commands myself but more of a person preference.
I also added migrate
triggers to the framework a little while ago, so at some point I will probably add a listeners option to this repo to auto-regenerate.
from codeigniter4-schemas.
I can't ssh into that specific server, so commands are a little complicated, unfortunately.
Migration triggers sounds pretty clever. Might also be a good way to have people deal with migration more (should maybe do that myself, too...
Closing as this will likely be covered or deprecated in the refactor.
from codeigniter4-schemas.
Once codeigniter4-tasks
is ready that would be another good way to activate schema generation, assuming you have access to the cron (e.g. from CPanel).
All you ideas and work are appreciated! Please don't balk from PRs just because "somewhere down the road this might change". I'm sharing some of my ideas without a specific roadmap, but the reality is I'm strapped for time for much module development.
from codeigniter4-schemas.
That would be feasible. In gerneral, I like the idea of decoupling such actions from the app and its interface.
I will see what I think is really useful changes in the end, if I'm confident with a solution, I will happily reinstate the PR :)
from codeigniter4-schemas.
Related Issues (19)
- codeigniter4-schemas/src/Handlers/DatabaseHandler.php HOT 26
- Function getErrors always returns [] HOT 1
- how to override schema for few fields HOT 8
- Issue with optimization HOT 5
- Help: Many To Many example HOT 1
- unable connect postgre database HOT 1
- Cache crashes HOT 1
- Handler Naming Convention
- Change: Remove Reflection class HOT 1
- How to use this package? HOT 5
- PHP 8.1 Fatal error HOT 2
- Access to an undefined property Tatter\Schemas\Structures\Mergeable::$orders. HOT 2
- Can one object belongsTo more than one user ? HOT 1
- After upgrading to CI4 v4.3.0, the generated schema is broken and can't be used with relations. HOT 2
- Error When Running `php spark schemas` with CodeIgniter Shield: Cannot Instantiate Abstract Class HOT 2
- Feature: Multiple Models
- Feature: Toolbar collector HOT 1
- Error: undefined function: plural() HOT 2
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 codeigniter4-schemas.