1 Chronicles 17:19

O LORD, for thy servant’s sake, and according to thine own heart, hast thou done all this greatness, in making known all these great things.

The verse belongs to the account in which David first conceived the design of building a house worthy of the divine majesty and opened his mind about it to the prophet Nathan. God accepted David's good intentions yet refused him the honor of building, reserving the work of raising the temple for his son Solomon, for whom David provided the materials before his death. God did all this greatness and made known all these great things for his servant's sake and according to his own heart and purpose. His works and the making known of his promises are thus acts of divine goodness, not something David had earned.